pub struct Turns { /* private fields */ }
Implementations§
Source§impl Turns
Generic turn methods.
impl Turns
Generic turn methods.
pub fn with(pieces: Pieces) -> Self
pub fn set_to_move(&mut self, side: Side)
pub fn curr_turn(&self) -> usize
pub fn inner_ref(&self) -> &Vec<Pieces>
pub fn working_board_ref(&self) -> &Pieces
pub fn working_board_mut(&mut self) -> &mut Pieces
Sourcepub fn save_turn(&mut self)
pub fn save_turn(&mut self)
Saves the working board as a turn.
Follows standard saving procedure used throughout applications. When the turn is:
- not the most recent turn: truncates the turns s.t. the current turn is the most recent, continue below
- the most recent turn: pushes a clone of the working board to the turns, increments curr_turn
pub fn first(&mut self)
pub fn last(&mut self)
pub fn prev(&mut self) -> Result<(), ()>
pub fn next(&mut self) -> Result<(), ()>
Source§impl Turns
Engine code.
impl Turns
Engine code.
Sourcepub fn make_best_move(&mut self)
pub fn make_best_move(&mut self)
Make the best move for the current player from self.to_move
.
Auto Trait Implementations§
impl Freeze for Turns
impl RefUnwindSafe for Turns
impl Send for Turns
impl Sync for Turns
impl Unpin for Turns
impl UnwindSafe for Turns
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