MatchPlayers
data class MatchPlayers(val player1: Player? = null, val player2: Player? = null) : Iterable<Player>
Represents the players in a Reversi match, supporting zero to two players.
Properties
Functions
Link copied to clipboard
Adds a new player to the match if there is space available and the player type is not already taken.
Link copied to clipboard
Returns a list of available piece types that can be assigned to new players. If both players are already assigned, the list will be empty.
Link copied to clipboard
Gets the next available piece type that has not yet been assigned.
Link copied to clipboard
Gets a player by their piece type.
Link copied to clipboard
Checks if exactly one player has been assigned.
Link copied to clipboard
Checks if at least one player has been assigned.
Link copied to clipboard
Refreshes both players' point counts based on the current board state.