chipiron.utils.communication package

Subpackages

Submodules

chipiron.utils.communication.gui_player_message module

Module to extract messages from players to be shown in the GUI.

class chipiron.utils.communication.gui_player_message.PlayersColorToPlayerMessage(player_color_to_factory_args: dict[bool, chipiron.players.player_args.PlayerFactoryArgs])[source]

Bases: object

Represents a mapping of player colors to GUI information.

Variables:

player_color_to_gui_info (dict[chess.Color, str]) – A dictionary mapping player colors to GUI information.

player_color_to_factory_args: dict[bool, chipiron.players.player_args.PlayerFactoryArgs]

chipiron.utils.communication.player_game_messages module

Module to define the messages that are sent between the players and the game.

class chipiron.utils.communication.player_game_messages.BoardMessage(fen_plus_moves: FenPlusHistory, seed: int | None = None)[source]

Bases: object

Represents a message containing the current state of the chess board.

Variables:
  • fen_plus_moves (FenPlusMoves) – The original fen and the subsequent moves to be applied.

  • seed (int | None, optional) – The seed used for random number generation. Defaults to None.

fen_plus_moves: FenPlusHistory
seed: int | None = None
class chipiron.utils.communication.player_game_messages.MoveMessage(move: str, corresponding_board: str, player_name: str, color_to_play: bool, evaluation: FloatyBoardEvaluation | ForcedOutcome | None = None)[source]

Bases: object

Represents a message containing a move made by a player.

Variables:
  • move (chess.Move) – The move made by the player.

  • corresponding_board (fen) – The FEN representation of the board after the move.

  • player_name (str) – The name of the player who made the move.

  • color_to_play (chess.Color) – The color of the player to play after the move.

  • evaluation (float | None, optional) – The evaluation score of the move. Defaults to None.

color_to_play: bool
corresponding_board: str
evaluation: FloatyBoardEvaluation | ForcedOutcome | None = None
move: str
player_name: str

Module contents