pub struct Turn { /* private fields */ }Expand description
A checker turn entered one legal step at a time.
The continuation set is filtered from complete legal plays, so partial input cannot bypass the maximum-dice or higher-die rules.
Implementations§
Source§impl Turn
impl Turn
pub fn new(position: Position, dice: Dice) -> Result<Self, TurnError>
pub const fn initial_position(&self) -> Position
pub const fn preview_position(&self) -> Position
pub const fn dice(&self) -> Dice
pub fn steps(&self) -> &[Step]
pub fn remaining_dice(&self) -> Vec<u8> ⓘ
pub fn legal_steps(&self) -> Vec<Step>
pub fn select(&mut self, step: Step) -> Result<(), TurnError>
pub fn undo(&mut self) -> bool
pub fn is_pass(&self) -> bool
pub fn is_complete(&self) -> bool
pub fn completed_play(&self) -> Option<&Play>
pub fn finish(self) -> Result<Play, TurnError>
Trait Implementations§
impl Eq for Turn
impl StructuralPartialEq for Turn
Auto Trait Implementations§
impl Freeze for Turn
impl RefUnwindSafe for Turn
impl Send for Turn
impl Sync for Turn
impl Unpin for Turn
impl UnsafeUnpin for Turn
impl UnwindSafe for Turn
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