Struct chess_turn_engine::ChessTurnEngine
source · [−]pub struct ChessTurnEngine { /* private fields */ }Expand description
Game engine
Implementations
sourceimpl ChessTurnEngine
impl ChessTurnEngine
sourcepub fn display(&self, opt: DisplayOption) -> String
pub fn display(&self, opt: DisplayOption) -> String
sourcepub fn display_on_screen(&self, opt: DisplayOption)
pub fn display_on_screen(&self, opt: DisplayOption)
sourcepub fn play_turn(&mut self, turn: &str) -> Result<Gamestate, GameError>
pub fn play_turn(&mut self, turn: &str) -> Result<Gamestate, GameError>
Play provided turn.
Return value
Ok- Latest game status.Err-GameErrorin case turn is not playable.
Arguments
turn- Turn provided in chess notation format
sourcepub fn undo_turn(&mut self) -> Result<(), GameError>
pub fn undo_turn(&mut self) -> Result<(), GameError>
Undo turn and restore previous board state
sourcepub fn available_turns(&self) -> &Vec<AvailableTurn>
pub fn available_turns(&self) -> &Vec<AvailableTurn>
Get list of available turns
Auto Trait Implementations
impl RefUnwindSafe for ChessTurnEngine
impl Send for ChessTurnEngine
impl Sync for ChessTurnEngine
impl Unpin for ChessTurnEngine
impl UnwindSafe for ChessTurnEngine
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more