pub struct Dice { /* private fields */ }Expand description
Represents the two dice needed to move checkers.
Implementations§
Trait Implementations§
Source§impl Roll for Dice
impl Roll for Dice
Source§fn roll(&mut self, player: Player) -> Result<(), Error>
fn roll(&mut self, player: Player) -> Result<(), Error>
Roll the dice, which generates two random numbers between 1 and 6, replicating the action of a perfect die. We use the operating system’s random number generator.
Source§fn set_dice(&mut self, _player: Player, v: (u8, u8)) -> Result<(), Error>
fn set_dice(&mut self, _player: Player, v: (u8, u8)) -> Result<(), Error>
Sets the values of a pair of dice and validates the input.
Source§fn dice_consumed(&self) -> bool
fn dice_consumed(&self) -> bool
Check if the dice are fully consumed.
impl StructuralPartialEq for Dice
Auto Trait Implementations§
impl Freeze for Dice
impl RefUnwindSafe for Dice
impl Send for Dice
impl Sync for Dice
impl Unpin for Dice
impl UnsafeUnpin for Dice
impl UnwindSafe for Dice
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