Files
YAEP/domain/src/commonTest/kotlin/ch/dissem/yaep/domain/ClueTest.kt
Christian Basler 082899152f Improvements
try to make it run on Android (still unsuccessful)
2024-08-21 00:37:29 +02:00

27 lines
796 B
Kotlin

package ch.dissem.yaep.domain
abstract class ClueTest {
protected val size = 6
protected fun createGrid(
selection: (Item<ItemClass<*>>) -> Item<ItemClass<*>>? = { it }
) = Grid(
ItemClass.randomClasses(size)
.map {
it.randomItems(size).map { item -> Item(item) }
}
.map { row ->
GameRow(
category = row.first().itemType.companion,
options = row,
cells = row.map {
GameCell(
selection = selection(it),
solution = it,
options = mutableListOf()
)
}
)
}
)
}