game
Types
pub type Game {
Game(
board: BoardBB,
turn: Color,
history: List(Move),
status: Status,
ply: Int,
white_kingside_castle: CastleRights,
white_queenside_castle: CastleRights,
black_kingside_castle: CastleRights,
black_queenside_castle: CastleRights,
en_passant: Option(Position),
)
}
Constructors
-
Game( board: BoardBB, turn: Color, history: List(Move), status: Status, ply: Int, white_kingside_castle: CastleRights, white_queenside_castle: CastleRights, black_kingside_castle: CastleRights, black_queenside_castle: CastleRights, en_passant: Option(Position), )
pub type Message {
AllLegalMoves(reply_with: Subject(List(Move)))
ApplyMove(reply_with: Subject(Game), move: Move)
ApplyMoveUCI(reply_with: Subject(Game), move: String)
UndoMove(reply_with: Subject(Game))
Shutdown
PrintBoard(reply_with: Subject(Nil))
}
Constructors
-
AllLegalMoves(reply_with: Subject(List(Move)))
-
ApplyMove(reply_with: Subject(Game), move: Move)
-
ApplyMoveUCI(reply_with: Subject(Game), move: String)
-
UndoMove(reply_with: Subject(Game))
-
Shutdown
-
PrintBoard(reply_with: Subject(Nil))
pub type Status {
Checkmate
Stalemate
InProgress
}
Constructors
-
Checkmate
-
Stalemate
-
InProgress
Functions
pub fn all_legal_moves(
game_actor: Subject(Message),
) -> List(Move)
pub fn apply_move(
game_actor: Subject(Message),
move: Move,
) -> Game
pub fn apply_move_uci(
game_actor: Subject(Message),
move_uci: String,
) -> Game
pub fn new_game() -> Subject(Message)
pub fn new_game_from_fen(fen_string: String) -> Subject(Message)
pub fn print_board(game_actor: Subject(Message)) -> Nil
pub fn print_board_from_fen(fen: String) -> Nil
pub fn undo_move(game_actor: Subject(Message)) -> Game