game_server

Types

pub type Message {
  AllLegalMoves(reply_with: Subject(List(Move)))
  ApplyMove(
    reply_with: Subject(Result(Game, String)),
    move: Move,
  )
  ApplyMoveUciString(
    reply_with: Subject(Result(Game, String)),
    move: String,
  )
  ApplyMoveSanString(
    reply_with: Subject(Result(Game, String)),
    move: String,
  )
  ApplyMoveRaw(
    reply_with: Subject(Result(Game, String)),
    move: Move,
  )
  UndoMove(reply_with: Subject(Result(Game, String)))
  GetState(reply_with: Subject(Game))
  GetSideToMove(reply_with: Subject(Color))
  GetFen(reply_with: Subject(String))
  GetStatus(reply_with: Subject(Option(Status)))
  NewGame(reply_with: Subject(Game))
  NewGameFromFen(
    reply_with: Subject(Result(Game, String)),
    fen: String,
  )
  DisableStatus(reply_with: Subject(Result(Game, Nil)))
  Shutdown
  PrintBoard(reply_with: Subject(Result(String, String)))
}

Constructors

  • AllLegalMoves(reply_with: Subject(List(Move)))
  • ApplyMove(reply_with: Subject(Result(Game, String)), move: Move)
  • ApplyMoveUciString(
      reply_with: Subject(Result(Game, String)),
      move: String,
    )
  • ApplyMoveSanString(
      reply_with: Subject(Result(Game, String)),
      move: String,
    )
  • ApplyMoveRaw(
      reply_with: Subject(Result(Game, String)),
      move: Move,
    )
  • UndoMove(reply_with: Subject(Result(Game, String)))
  • GetState(reply_with: Subject(Game))
  • GetSideToMove(reply_with: Subject(Color))
  • GetFen(reply_with: Subject(String))
  • GetStatus(reply_with: Subject(Option(Status)))
  • NewGame(reply_with: Subject(Game))
  • NewGameFromFen(
      reply_with: Subject(Result(Game, String)),
      fen: String,
    )
  • DisableStatus(reply_with: Subject(Result(Game, Nil)))
  • Shutdown
  • PrintBoard(reply_with: Subject(Result(String, String)))

Functions

pub fn all_legal_moves(
  game_actor: Subject(Message),
) -> List(Move)
pub fn apply_move(
  game_actor: Subject(Message),
  move: Move,
) -> Result(Game, String)
pub fn apply_move_raw(
  game_actor: Subject(Message),
  move: Move,
) -> Result(Game, String)
pub fn apply_move_san_string(
  game_actor: Subject(Message),
  move_san: String,
) -> Result(Game, String)
pub fn apply_move_uci_string(
  game_actor: Subject(Message),
  move_uci: String,
) -> Result(Game, String)
pub fn disable_status(
  game_actor: Subject(Message),
) -> Result(Game, Nil)
pub fn get_fen(game_actor: Subject(Message)) -> String
pub fn get_status(game_actor: Subject(Message)) -> Option(Status)
pub fn load_pgn(
  pgn_string: String,
) -> Result(Subject(Message), String)
pub fn new_game(game_actor: Subject(Message)) -> Game
pub fn new_game_from_fen(
  game_actor: Subject(Message),
  fen: String,
) -> Result(Game, String)
pub fn new_server() -> Result(Subject(Message), StartError)
pub fn print_board(
  game_actor: Subject(Message),
) -> Result(String, String)
pub fn shutdown(game_actor: Subject(Message)) -> Nil
pub fn undo_move(
  game_actor: Subject(Message),
) -> Result(Game, String)
Search Document