pub struct Game {
pub rules: Rules,
pub dices: Dices,
pub who_plays: Player,
pub board: Board,
pub cube: Cube,
/* private fields */
}Expand description
Represents a Backgammon game
Fields§
§rules: RulesRules of the game
dices: DicesLast dice pair rolled
who_plays: PlayerWhose turn is it?
board: BoardBoard for player 0 and 1
cube: CubeCube value and owner
Implementations§
Trait Implementations§
Source§impl GameRules for Game
Implements SetRules for Game
impl GameRules for Game
Implements SetRules for Game
Source§fn with_beaver(self) -> Self
fn with_beaver(self) -> Self
When offered the cube, allow to re-double but keep it
Source§fn with_raccoon(self) -> Self
fn with_raccoon(self) -> Self
If a player plays “beaver”, the other may double again, letting the opponent keep the cube.
Source§fn with_murphy(self, limit: u8) -> Self
fn with_murphy(self, limit: u8) -> Self
If both players roll the same opening number, the dice is doubled, remaining in the middle
of the board.
Source§fn with_jacoby(self) -> Self
fn with_jacoby(self) -> Self
Gammon and Backgammon only count for double or triple values if the cube has already been
offered.
Source§fn with_holland(self) -> Self
fn with_holland(self) -> Self
Permits to double after Crawford game only if both players have rolled at least twice.
Auto Trait Implementations§
impl Freeze for Game
impl RefUnwindSafe for Game
impl Send for Game
impl Sync for Game
impl Unpin 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