Improvements
try to make it run on Android (still unsuccessful)
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
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()
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user