pub struct Game<const N: usize, const HALF_KOMI: i8> {
pub board: Board<N>,
pub to_move: Color,
pub white_reserves: Reserves<N>,
pub black_reserves: Reserves<N>,
pub ply: u16,
pub reversible_plies: u16,
}
Fields§
§board: Board<N>
§to_move: Color
§white_reserves: Reserves<N>
§black_reserves: Reserves<N>
§ply: u16
§reversible_plies: u16
Implementations§
Source§impl<const N: usize, const HALF_KOMI: i8> Game<N, HALF_KOMI>
impl<const N: usize, const HALF_KOMI: i8> Game<N, HALF_KOMI>
Sourcepub fn possible_moves(&self, moves: &mut Vec<Move>)
pub fn possible_moves(&self, moves: &mut Vec<Move>)
Populate moves vector with all possible moves for the current position.
§Panics
If the move vector is not empty.
Source§impl<const N: usize, const HALF_KOMI: i8> Game<N, HALF_KOMI>
impl<const N: usize, const HALF_KOMI: i8> Game<N, HALF_KOMI>
Sourcepub fn from_moves(moves: &[Move]) -> Result<Self, PlayError>
pub fn from_moves(moves: &[Move]) -> Result<Self, PlayError>
Sourcepub fn from_ptn_moves(moves: &[&str]) -> Self
pub fn from_ptn_moves(moves: &[&str]) -> Self
Creates a default game and plays all the moves after parsing them.
§Panics
Panics if there is an error in parsing or if any move is invalid during play.
Trait Implementations§
Source§impl<const N: usize, const HALF_KOMI: i8> Ord for Game<N, HALF_KOMI>
impl<const N: usize, const HALF_KOMI: i8> Ord for Game<N, HALF_KOMI>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<const N: usize, const HALF_KOMI: i8> PartialOrd for Game<N, HALF_KOMI>
impl<const N: usize, const HALF_KOMI: i8> PartialOrd for Game<N, HALF_KOMI>
Source§impl<const N: usize, const HALF_KOMI: i8> Symmetry<N> for Game<N, HALF_KOMI>
impl<const N: usize, const HALF_KOMI: i8> Symmetry<N> for Game<N, HALF_KOMI>
fn symmetries(&self) -> [Self; 8]
impl<const N: usize, const HALF_KOMI: i8> Eq for Game<N, HALF_KOMI>
impl<const N: usize, const HALF_KOMI: i8> StructuralPartialEq for Game<N, HALF_KOMI>
Auto Trait Implementations§
impl<const N: usize, const HALF_KOMI: i8> Freeze for Game<N, HALF_KOMI>
impl<const N: usize, const HALF_KOMI: i8> RefUnwindSafe for Game<N, HALF_KOMI>
impl<const N: usize, const HALF_KOMI: i8> Send for Game<N, HALF_KOMI>
impl<const N: usize, const HALF_KOMI: i8> Sync for Game<N, HALF_KOMI>
impl<const N: usize, const HALF_KOMI: i8> Unpin for Game<N, HALF_KOMI>
impl<const N: usize, const HALF_KOMI: i8> UnwindSafe for Game<N, HALF_KOMI>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more