Struct backgammon::rules::Rules
source · pub struct Rules {
pub points: u32,
pub beaver: bool,
pub raccoon: bool,
pub murphy: bool,
pub murphy_limit: u8,
pub jacoby: bool,
pub crawford: bool,
pub holland: bool,
}
Expand description
Holds all the rule settings
Fields§
§points: u32
The amount of points to reach for declaring a winner of the match, default is 7.
beaver: bool
When offered the cube, allow to re-double but keep it, default is false.
raccoon: bool
If a player plays “beaver”, the other may double again, letting the opponent keep the cube. Default is false
murphy: bool
If both players roll the same opening number, the dice is doubled, remaining in the middle of the board. Default is false.
murphy_limit: u8
How often to apply automatic doubling rule. 0 means always on. Default is 0.
jacoby: bool
Gammon and Backgammon only count for double or triple values if the cube has already been offered. Default is false.
crawford: bool
When a player first reaches a score of points - 1, no doubling is allowed for the following game. Default is true.
holland: bool
Permits to double after Crawford game only if both players have rolled at least twice. Default is false.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Rules
impl<'de> Deserialize<'de> for Rules
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl GameRules for Rules
impl GameRules for Rules
Implements SetRules for Rules
source§fn with_beaver(self) -> Self
fn with_beaver(self) -> Self
source§fn with_raccoon(self) -> Self
fn with_raccoon(self) -> Self
source§fn with_murphy(self, limit: u8) -> Self
fn with_murphy(self, limit: u8) -> Self
source§fn with_jacoby(self) -> Self
fn with_jacoby(self) -> Self
source§fn with_holland(self) -> Self
fn with_holland(self) -> Self
source§impl MatchRules for Rules
impl MatchRules for Rules
Implements SetRules for Rules
source§fn with_points(self, points: u32) -> Self
fn with_points(self, points: u32) -> Self
source§fn with_crawford(self) -> Self
fn with_crawford(self) -> Self
source§impl Ord for Rules
impl Ord for Rules
source§impl PartialEq<Rules> for Rules
impl PartialEq<Rules> for Rules
source§impl PartialOrd<Rules> for Rules
impl PartialOrd<Rules> for Rules
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more