Xiangiqgame
AI engine for Xiangqi
Loading...
Searching...
No Matches
xiangqipy.game_summary_io Namespace Reference

Contains functions for importing / exporting a GameSummary from / to .json file. More...

Functions

Any enc_hook (Any obj)
 
Any dec_hook (Type type, Any obj)
 
GameSummary import_game_summary (Path path)
 
def export_game_summary (GameSummary game_summary, Path path)
 

Variables

msgspec encoder = msgspec.json.Encoder(enc_hook=enc_hook)
 
msgspec decoder = msgspec.json.Decoder(GameSummary, dec_hook=dec_hook)
 
PieceColor my_piece_color = PieceColor.kRed
 
int my_int = int(my_piece_color)
 

Detailed Description

Contains functions for importing / exporting a GameSummary from / to .json file.

Function Documentation

◆ dec_hook()

Any xiangqipy.game_summary_io.dec_hook ( Type  type,
Any  obj 
)

Definition at line 26 of file game_summary_io.py.

◆ enc_hook()

Any xiangqipy.game_summary_io.enc_hook ( Any  obj)

Definition at line 13 of file game_summary_io.py.

◆ export_game_summary()

def xiangqipy.game_summary_io.export_game_summary ( GameSummary  game_summary,
Path  path 
)

Definition at line 52 of file game_summary_io.py.

◆ import_game_summary()

GameSummary xiangqipy.game_summary_io.import_game_summary ( Path  path)

Definition at line 46 of file game_summary_io.py.

Variable Documentation

◆ decoder

msgspec xiangqipy.game_summary_io.decoder = msgspec.json.Decoder(GameSummary, dec_hook=dec_hook)

Definition at line 43 of file game_summary_io.py.

◆ encoder

msgspec xiangqipy.game_summary_io.encoder = msgspec.json.Encoder(enc_hook=enc_hook)

Definition at line 42 of file game_summary_io.py.

◆ my_int

int xiangqipy.game_summary_io.my_int = int(my_piece_color)

Definition at line 67 of file game_summary_io.py.

◆ my_piece_color

PieceColor xiangqipy.game_summary_io.my_piece_color = PieceColor.kRed

Definition at line 66 of file game_summary_io.py.