package ch.dissem.yaep.domain

abstract class ClueTest {
    protected val size: Int = 6

    protected fun createGrid(
        selection: (Item<ItemClass<*>>) -> Item<ItemClass<*>>? = { it }
    ): Grid = 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()
                        )
                    }
                )
            }
    )
}