Package-level declarations

Overview

Data Transfer Objects (DTOs) for representing and persisting game state.

Key Components

  • GameState — Complete snapshot of a game including board, players, and metadata

  • Player — Player representation with piece type and score

  • MatchPlayers — Collection of players in a match

Responsibilities

  • Providing serializable game state representations

  • Enabling game persistence and restoration

  • Serving as data contracts between core and storage modules

Types

Link copied to clipboard
data class GameState(val players: MatchPlayers, val lastPlayer: PieceType, val board: Board, val winner: Player? = null)

Represents the state of a Reversi game, including the last player who made a move and the current board configuration.

Link copied to clipboard
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.

Link copied to clipboard
data class Player(val type: PieceType, val name: String = type.name, val points: Int = 0)

Represents a player in the game.