pub struct Rules { /* private fields */ }Expand description
Holds all the rule settings.
Implementations§
Source§impl Rules
impl Rules
Sourcepub fn get_points(&self) -> u32
pub fn get_points(&self) -> u32
Returns the number of points required to win the match.
Sourcepub fn is_raccoon(&self) -> bool
pub fn is_raccoon(&self) -> bool
Returns whether the raccoon rule is enabled.
Sourcepub fn get_murphy_limit(&self) -> Result<u8, Error>
pub fn get_murphy_limit(&self) -> Result<u8, Error>
Returns the murphy limit if murphy rule is enabled.
Sourcepub fn is_crawford(&self) -> bool
pub fn is_crawford(&self) -> bool
Returns whether the crawford rule is enabled.
Sourcepub fn is_holland(&self) -> bool
pub fn is_holland(&self) -> bool
Returns whether the holland rule is enabled.
Trait Implementations§
Source§impl GameRules for Rules
Implements SetRules for Rules
impl GameRules for Rules
Implements SetRules for Rules
Source§fn with_beaver(&mut self) -> Result<(), Error>
fn with_beaver(&mut self) -> Result<(), Error>
When offered the cube, allow to re-double but keep it
Source§fn with_raccoon(&mut self) -> Result<(), Error>
fn with_raccoon(&mut self) -> Result<(), Error>
If a player plays “beaver”, the other may double again, letting the opponent keep the cube.
Source§fn with_murphy(&mut self, limit: u8) -> Result<(), Error>
fn with_murphy(&mut self, limit: u8) -> Result<(), Error>
If both players roll the same opening number, the dice is doubled, remaining in the middle
of the board.
Source§impl MatchRules for Rules
Implements SetRules for Rules
impl MatchRules for Rules
Implements SetRules for Rules
Source§impl Ord for Rules
impl Ord for Rules
Source§impl PartialOrd for Rules
impl PartialOrd for Rules
impl Copy for Rules
impl Eq for Rules
impl StructuralPartialEq for Rules
Auto Trait Implementations§
impl Freeze for Rules
impl RefUnwindSafe for Rules
impl Send for Rules
impl Sync for Rules
impl Unpin for Rules
impl UnwindSafe for Rules
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