pub struct Rules { /* private fields */ }Expand description
Holds all the rule settings.
Trait Implementations§
Source§impl MatchRules for Rules
impl MatchRules for Rules
Source§fn get_points(&self) -> Result<u64, Error>
fn get_points(&self) -> Result<u64, Error>
Returns the number of points required to win the match.
Source§fn get_murphy(&self) -> Result<(bool, u8), Error>
fn get_murphy(&self) -> Result<(bool, u8), Error>
Returns the Murphy limit if murphy rule is enabled.
Source§fn set_points(&mut self, points: u64) -> Result<(), Error>
fn set_points(&mut self, points: u64) -> Result<(), Error>
Set the number of points required to win the match.
Source§fn set_crawford(&mut self, state: bool) -> Result<(), Error>
fn set_crawford(&mut self, state: bool) -> Result<(), Error>
Apply the Crawford rule: if the first player reaches a score of points - 1, no doubling is
allowed for the following game.
Source§fn set_beaver(&mut self, state: bool) -> Result<(), Error>
fn set_beaver(&mut self, state: bool) -> Result<(), Error>
Apply the Beaver rule: if offered the cube, allow to re-double but keep it.
Source§fn set_raccoon(&mut self, state: bool) -> Result<(), Error>
fn set_raccoon(&mut self, state: bool) -> Result<(), Error>
Apply the Raccoon rule: if a player beavered the offered cube, the other may double again,
letting the player keep the cube. This requires the Crawford rule to be enabled.
Source§fn set_murphy(&mut self, state: bool, limit: u8) -> Result<(), Error>
fn set_murphy(&mut self, state: bool, limit: u8) -> Result<(), Error>
Apply the Murphy rule: if both players roll the same opening number, the cube is doubled,
remaining in the middle of the board. The limit parameter defines how often to apply the
automatic doubling rule in a Murphy game. 0 means always on.
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 UnsafeUnpin 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