NR
abstract class EntityTypeFactory<U : ECSEntity>(val entityType: EntityType) {
abstract fun create(entity: Entity): U
}
Size: a a a
NR
abstract class EntityTypeFactory<U : ECSEntity>(val entityType: EntityType) {
abstract fun create(entity: Entity): U
}
QH
NR
NR
IK
BP
ch
AV
IS
K
SI
IK
АХ
АХ
inline fun matrixLoop(range: Int, qux: (i: Int, j: Int) -> Boolean) {
loop1@ for (i in -range..range) {
for (j in -range..range) {
when (qux(i, j)) {
true -> break@loop1
false -> {
}
}
}
}
}
АХ
matrixLoop(pdata.range) {Здесь проблема в том что i, j переменных нет, как это понять?
if (cused >= camount) return@matrixLoop true
val blkdown = world.getBlockAt(block.x + i, block.y - 1, block.z + j)
val blkup = world.getBlockAt(block.x + i, block.y, block.z + j)
if (blkdown.type == FARMLAND && blkup.type.isAir) {
blkup.type = cropType
cused += 1;
}
return@matrixLoop false
}
QH
АХ
/**почему у них это тогда работает?)))
* Performs the given [action] on each element.
*/
@kotlin.internal.HidesMembers
public inline fun <T> Iterable<T>.forEach(action: (T) -> Unit): Unit {
for (element in this) action(element)
}
/**
* Performs the given [action] on each element, providing sequential index with the element.
* @param [action] function that takes the index of an element and the element itself
* and performs the desired action on the element.
*/
public inline fun <T> Iterable<T>.forEachIndexed(action: (index: Int, T) -> Unit): Unit {
var index = 0
for (item in this) action(checkIndexOverflow(index++), item)
}
АХ
QH