Struct littlewing::game::Game [−][src]
pub struct Game { pub protocol: Protocol, pub starting_fen: String, pub is_debug: bool, pub is_eval_verbose: bool, pub is_search_verbose: bool, pub is_colored: bool, pub show_coordinates: bool, pub threads_count: usize, pub nodes_count: u64, pub clock: Clock, pub bitboards: [Bitboard; 14], pub board: [Piece; 64], pub moves: PieceMoveList, pub positions: Positions, pub zobrist: Zobrist, pub history: Vec<PieceMove>, pub tt: TranspositionTable, }
A Game
type to store the state of a chess game
Fields
protocol: Protocol
starting_fen: String
is_debug: bool
is_eval_verbose: bool
is_search_verbose: bool
is_colored: bool
show_coordinates: bool
threads_count: usize
nodes_count: u64
clock: Clock
bitboards: [Bitboard; 14]
board: [Piece; 64]
moves: PieceMoveList
positions: Positions
zobrist: Zobrist
history: Vec<PieceMove>
tt: TranspositionTable
Methods
impl Game
[src]
impl Game
pub fn new() -> Game
[src]
pub fn new() -> Game
Create a new Game
pub fn tt_size(&self) -> usize
[src]
pub fn tt_size(&self) -> usize
Get the transposition table size in byte
pub fn tt_resize(&mut self, memory: usize)
[src]
pub fn tt_resize(&mut self, memory: usize)
Resize the transposition table at the given size in byte or the next power of two
pub fn clear(&mut self)
[src]
pub fn clear(&mut self)
Clear the current game state
pub fn bitboard(&self, piece: Piece) -> &Bitboard
[src]
pub fn bitboard(&self, piece: Piece) -> &Bitboard
Get a bitboard representation of the given piece in the game
pub fn side(&self) -> Color
[src]
pub fn side(&self) -> Color
Get the current side color
Trait Implementations
impl Eval for Game
[src]
impl Eval for Game
fn eval(&self) -> i16
[src]
fn eval(&self) -> i16
Evaluate the current position
fn eval_material(&self, c: Color) -> i16
[src]
fn eval_material(&self, c: Color) -> i16
Evaluate material at the current position for the given side
fn see(&self, capture: PieceMove) -> i16
[src]
fn see(&self, capture: PieceMove) -> i16
Static Exchange Evaluation
impl FEN for Game
[src]
impl FEN for Game
fn from_fen(fen: &str) -> Game
[src]
fn from_fen(fen: &str) -> Game
Create Game
from a given FEN string
fn load_fen(&mut self, fen: &str)
[src]
fn load_fen(&mut self, fen: &str)
Load game state from a given FEN string
fn to_fen(&self) -> String
[src]
fn to_fen(&self) -> String
Export game state to a FEN string
impl Clone for Game
[src]
impl Clone for Game
fn clone(&self) -> Game
[src]
fn clone(&self) -> Game
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Display for Game
[src]
impl Display for Game
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PieceMoveGenerator for Game
[src]
impl PieceMoveGenerator for Game
fn generate_moves(&mut self)
[src]
fn generate_moves(&mut self)
Generate the list of moves from the current game position
fn sort_moves(&mut self)
[src]
fn sort_moves(&mut self)
Sort the moves list to try good candidates first in search
fn next_move(&mut self) -> Option<PieceMove>
[src]
fn next_move(&mut self) -> Option<PieceMove>
Get the next move from the moves list (for regular search)
fn next_capture(&mut self) -> Option<PieceMove>
[src]
fn next_capture(&mut self) -> Option<PieceMove>
Get the next capture from the moves list (for quiescence search)
fn make_move(&mut self, m: PieceMove)
[src]
fn make_move(&mut self, m: PieceMove)
Make the given move and update the game state
fn undo_move(&mut self, m: PieceMove)
[src]
fn undo_move(&mut self, m: PieceMove)
Undo the given move and update the game state
impl PieceMoveNotation for Game
[src]
impl PieceMoveNotation for Game
fn move_from_can(&mut self, s: &str) -> PieceMove
[src]
fn move_from_can(&mut self, s: &str) -> PieceMove
Get move from the given SAN string
fn move_to_san(&mut self, m: PieceMove) -> String
[src]
fn move_to_san(&mut self, m: PieceMove) -> String
Get SAN string from the given move
impl Search for Game
[src]
impl Search for Game
fn perft(&mut self, depth: i8) -> u64
[src]
fn perft(&mut self, depth: i8) -> u64
Search the number of legal moves at the given depth
fn search(&mut self, depths: Range<i8>) -> Option<PieceMove>
[src]
fn search(&mut self, depths: Range<i8>) -> Option<PieceMove>
Searh the best move at the given depth range
fn search_root(&mut self, depths: Range<i8>) -> Option<PieceMove>
[src]
fn search_root(&mut self, depths: Range<i8>) -> Option<PieceMove>
Searh the best move from the root position at the given depth range
fn search_node(&mut self, alpha: i16, beta: i16, depth: i8, ply: usize) -> i16
[src]
fn search_node(&mut self, alpha: i16, beta: i16, depth: i8, ply: usize) -> i16
Searh the best score between alpha and beta from a node position at the given depth
fn quiescence(&mut self, alpha: i16, beta: i16, depth: i8, ply: usize) -> i16
[src]
fn quiescence(&mut self, alpha: i16, beta: i16, depth: i8, ply: usize) -> i16
Specialized quiescence search
fn is_mate(&mut self) -> bool
[src]
fn is_mate(&mut self) -> bool