The data model used to represent the pair of dice used to play Game of Ur.
Definition dice.hpp:27
bool getSecondaryRoll() const
Gets the value of the secondary die, either Double or Quits.
Definition dice.hpp:87
State mState
The current state of the dice.
Definition dice.hpp:143
std::uniform_int_distribution< int > mYesNoDieDistribution
The range of integer values possible for the secondary die, where each integer has an even chance of ...
Definition dice.hpp:167
uint8_t mPrimaryRoll
The score on the primary die, a value between 1 and 4.
Definition dice.hpp:131
State getState() const
Gets the current state of the dice.
Definition dice.hpp:66
std::default_random_engine mRandomEngine
The engine used to produce random values (I don't really know).
Definition dice.hpp:155
uint8_t upgradedRoll() const
Maps the score of the primary die to its result score if one rolled Double with the secondary die.
Definition dice.cpp:44
std::uniform_int_distribution< int > mPrimaryDieDistribution
A meaningful range of integer values used by the primary die, where each value has an even chance of ...
Definition dice.hpp:161
uint8_t getPrimaryRoll() const
Gets the value of the primary die, between 1 and 4.
Definition dice.hpp:76
bool canRoll() const
Tests whether rolling the dice is presently possible.
Definition dice.hpp:59
bool mSecondaryRoll
The score on the secondary die, either Double or Quits, where true -> Double, false -> Quits.
Definition dice.hpp:137
void roll()
After validating that a roll is possible, rolls one of the dice.
Definition dice.cpp:29
State
Values representing all possible states for this pair of dice.
Definition dice.hpp:33
uint8_t getResult(GamePhase currentPhase) const
Gets the score represented by both dice combined for the current phase of the game.
Definition dice.cpp:7
std::random_device mRandomDevice
The device used as the source of random values.
Definition dice.hpp:149
void reset()
Resets the state of the dice to State::UNROLLED.
Definition dice.cpp:5
GamePhase
A value representing the high level phase of an entire game.
Definition phase.hpp:20
Enums whose values represent the different phases a game can be in.