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.

player_color_to_gui_info

A dictionary mapping player colors to GUI information.

Type:

dict[chess.Color, str]

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.

fen_plus_moves

The original fen and the subsequent moves to be applied.

Type:

FenPlusMoves

seed

The seed used for random number generation. Defaults to None.

Type:

int | None, optional

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.

move

The move made by the player.

Type:

chess.Move

corresponding_board

The FEN representation of the board after the move.

Type:

fen

player_name

The name of the player who made the move.

Type:

str

color_to_play

The color of the player to play after the move.

Type:

chess.Color

evaluation

The evaluation score of the move. Defaults to None.

Type:

float | None, optional

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

Module contents