pub struct Game { /* private fields */ }Expand description
A cubeless game from the opening roll through its final checker play.
Implementations§
Source§impl Game
impl Game
pub const fn new() -> Self
pub const fn position(&self) -> Position
pub const fn phase(&self) -> GamePhase
pub fn restart(&mut self)
Sourcepub fn opening_roll(&mut self, white: u8, black: u8) -> Result<bool, GameError>
pub fn opening_roll(&mut self, white: u8, black: u8) -> Result<bool, GameError>
Applies the opening roll, returning false when the dice tie and must be rerolled.
Sourcepub fn roll(&mut self, dice: Dice) -> Result<(), GameError>
pub fn roll(&mut self, dice: Dice) -> Result<(), GameError>
Starts the next checker turn with dice supplied by the caller.
pub fn legal_plays(&self) -> Vec<Play>
Trait Implementations§
impl Eq for Game
impl StructuralPartialEq for Game
Auto Trait Implementations§
impl Freeze for Game
impl RefUnwindSafe for Game
impl Send for Game
impl Sync for Game
impl Unpin for Game
impl UnsafeUnpin for Game
impl UnwindSafe for Game
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