Package-level declarations
Overview
Core game logic and game orchestration components.
Key Components
Game— Main game class that coordinates gameplayGameLogic— Pure functions for move validation and board transformationsGameUtils— Helper utilities for game operationsGameService— Interface for game service implementationsEmptyGameService— No-op implementation for local gamesFakeGameService— Mock implementation for testingGameServiceImpl— Real implementation for networked/multiplayer games
Responsibilities
Managing game state and flow
Validating and executing moves
Computing available plays
Handling game endings
Coordinating with external game services (multiplayer)
Types
Represents a Reversi game, managing the game state, player turns, and interactions with storage. The game has two modes: local and not local.
Functions
Loads an existing game from storage. It is recommended to use this method only connecting to a not local game. Ensures that the player with the specified piece type is included in the loaded game. Removes the player from storage to avoid conflicts in future loads.
Creates a new game instance for testing purposes with specified board and player configuration.
Starts a new game. It is recommended to use this method only to create a not local game. If is not a local game makes available the opponent player in storage for future loads.
Converts the game board to a string representation with row/column labels and target markers. If target mode is enabled, available plays are marked with the target character.