Match

class Match(val config: MatchConfig, scope: CoroutineScope, host: MatchHost, aiDispatcher: CoroutineDispatcher = Dispatchers.Default, aiDelayMs: Long = 420, random: Random = Random.Default)

State for one sitting: a series of rounds between the same two seats, with a running session score. Rounds alternate who starts. Compose reads the fields directly.

Constructors

Link copied to clipboard
constructor(config: MatchConfig, scope: CoroutineScope, host: MatchHost, aiDispatcher: CoroutineDispatcher = Dispatchers.Default, aiDelayMs: Long = 420, random: Random = Random.Default)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var draws: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var oWins: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var round: Int
Link copied to clipboard
var turn: Mark
Link copied to clipboard
var win: WinLine?
Link copied to clipboard
var xWins: Int

Functions

Link copied to clipboard
fun dispose()
Link copied to clipboard
fun onRemote(message: LanMessage)
Link copied to clipboard

"Play again": immediate locally, but both sides must agree over LAN.

Link copied to clipboard
fun restore(board: Board, turn: Mark, round: Int, xWins: Int, oWins: Int, draws: Int)

Puts a saved sitting back exactly as it was, then lets the AI continue if it was its move.

Link copied to clipboard
fun starterOf(round: Int): Mark
Link copied to clipboard
fun tap(index: Int)