pub struct QuantikBoard { /* private fields */ }Expand description
High-level Quantik board with inventory tracking, move history, and undo.
Implementations§
Source§impl QuantikBoard
impl QuantikBoard
pub fn new() -> Self
pub fn from_bitboard(bb: Bitboard) -> Result<Self, String>
pub fn from_qfen(qfen: &str) -> Result<Self, String>
pub fn bitboard(&self) -> &Bitboard
pub fn state(&self) -> State
pub fn current_player(&self) -> u8
pub fn inventories(&self) -> &[PlayerInventory; 2]
pub fn move_count(&self) -> usize
pub fn last_move(&self) -> Option<&Move>
pub fn to_qfen(&self) -> String
pub fn game_result(&self) -> GameResult
pub fn is_game_over(&self) -> bool
pub fn legal_moves(&self) -> Vec<Move>
pub fn is_legal(&self, mv: &Move) -> bool
pub fn play_move(&mut self, mv: Move) -> Result<(), String>
pub fn undo_move(&mut self) -> bool
pub fn undo_moves(&mut self, count: usize) -> usize
Trait Implementations§
Source§impl Default for QuantikBoard
impl Default for QuantikBoard
Auto Trait Implementations§
impl Freeze for QuantikBoard
impl RefUnwindSafe for QuantikBoard
impl Send for QuantikBoard
impl Sync for QuantikBoard
impl Unpin for QuantikBoard
impl UnsafeUnpin for QuantikBoard
impl UnwindSafe for QuantikBoard
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more