SudokuGameViewModel

ViewModel responsible for managing the state of the Sudoku game.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
val gameState: StateFlow<GameState>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
lateinit var sudokuSpec: SudokuSpec

Functions

Link copied to clipboard
expect open fun addCloseable(closeable: AutoCloseable)
expect fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
fun generateSudoku(dimension: Dimension, difficulty: Difficulty, seed: Seed)

Generates a new Sudoku puzzle based on the provided dimension, difficulty, and seed.

Link copied to clipboard
expect fun <T : AutoCloseable> getCloseable(key: String): T?
Link copied to clipboard
fun makeMove(row: Int, col: Int, value: Int)

Makes a move by updating the value of a cell at the specified row and column.

Link copied to clipboard
fun resetGame()

Resets the current Sudoku game, clearing the board and starting over.

Link copied to clipboard
fun selectCell(row: Int, col: Int)

Selects a cell at the specified row and column.