Xiangiqgame
AI engine for Xiangqi
Loading...
Searching...
No Matches
xiangqipy.game_summary.GameSummary Class Reference

Holds summary info of a xiangqipy.game.Game; implements msgspec.Struct for json IO. More...

Inheritance diagram for xiangqipy.game_summary.GameSummary:
Inheritance graph
Collaboration diagram for xiangqipy.game_summary.GameSummary:
Collaboration graph

Public Member Functions

int move_counts (self)
 Number of moves executed in the Game.
 
Dict[bindings.PieceColor, List[int]] move_numbers (self)
 Dictionary with list of move ID numbers executed by each player; normally Red player's list has odd integers, and Black's has even integers.
 
PlayerSummary get_player_summary (self, bindings.PieceColor player)
 Gets the xiangqipy.player_summary.PlayerSummary for a particular xiangqi_bindings.PieceColor.
 
pd.Series basic_stats (self)
 

Static Public Attributes

str game_id
 
GameState game_state
 
bindings whose_turn .PieceColor
 
List move_log [cdm.ExecutedMove]
 
PlayerSummaries player_summaries
 

Detailed Description

Holds summary info of a xiangqipy.game.Game; implements msgspec.Struct for json IO.

Attributes are all either primitives or from core_data_class_mirrors to minimize need for enc_hook's in msgspec IO.

Parameters
game_idstr: unique ID of the Game, typically based on timestamp when Game is instantiated.
game_statexiangqipy.enums.GameState: state of the Game.
whose_turnxianqi_bindings.PieceColor: color of Player to execute next move.
move_log(List[xiangqipy.core_dataclass_mirrors.ExecutedMove]): log of all executed moves.
player_summaries(PlayerSummaries): contains a xiangqipy.player_summary.PlayerSummary for each xiangqipy.players.AIPlayer in the Game.

Definition at line 30 of file game_summary.py.

Member Function Documentation

◆ basic_stats()

pd.Series xiangqipy.game_summary.GameSummary.basic_stats (   self)

Definition at line 82 of file game_summary.py.

◆ get_player_summary()

PlayerSummary xiangqipy.game_summary.GameSummary.get_player_summary (   self,
bindings.PieceColor  player 
)

Gets the xiangqipy.player_summary.PlayerSummary for a particular xiangqi_bindings.PieceColor.

Parameters
playerxiangqi_bindings.PieceColor of player that PlayerSummary is being retrieved for.

Definition at line 73 of file game_summary.py.

◆ move_counts()

int xiangqipy.game_summary.GameSummary.move_counts (   self)

Number of moves executed in the Game.

Definition at line 52 of file game_summary.py.

◆ move_numbers()

Dict[bindings.PieceColor, List[int]] xiangqipy.game_summary.GameSummary.move_numbers (   self)

Dictionary with list of move ID numbers executed by each player; normally Red player's list has odd integers, and Black's has even integers.

Definition at line 59 of file game_summary.py.

Member Data Documentation

◆ game_id

str xiangqipy.game_summary.GameSummary.game_id
static

Definition at line 45 of file game_summary.py.

◆ game_state

GameState xiangqipy.game_summary.GameSummary.game_state
static

Definition at line 46 of file game_summary.py.

◆ move_log

List xiangqipy.game_summary.GameSummary.move_log [cdm.ExecutedMove]
static

Definition at line 48 of file game_summary.py.

◆ player_summaries

PlayerSummaries xiangqipy.game_summary.GameSummary.player_summaries
static

Definition at line 49 of file game_summary.py.

◆ whose_turn

bindings xiangqipy.game_summary.GameSummary.whose_turn .PieceColor
static

Definition at line 47 of file game_summary.py.


The documentation for this class was generated from the following file: