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: u16Implementations§
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>where
Reserves<N>: Default,
impl<const N: usize, const HALF_KOMI: i8> Game<N, HALF_KOMI>where Reserves<N>: Default,
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> Default for Game<N, HALF_KOMI>where
Reserves<N>: Default,
impl<const N: usize, const HALF_KOMI: i8> Default for Game<N, HALF_KOMI>where Reserves<N>: Default,
source§impl<const N: usize, const HALF_KOMI: i8> From<Tps> for Game<N, HALF_KOMI>where
Reserves<N>: Default,
impl<const N: usize, const HALF_KOMI: i8> From<Tps> for Game<N, HALF_KOMI>where Reserves<N>: Default,
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> PartialEq<Game<N, HALF_KOMI>> for Game<N, HALF_KOMI>
impl<const N: usize, const HALF_KOMI: i8> PartialEq<Game<N, HALF_KOMI>> for Game<N, HALF_KOMI>
source§impl<const N: usize, const HALF_KOMI: i8> PartialOrd<Game<N, HALF_KOMI>> for Game<N, HALF_KOMI>
impl<const N: usize, const HALF_KOMI: i8> PartialOrd<Game<N, HALF_KOMI>> for Game<N, HALF_KOMI>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§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> StructuralEq 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> 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