Dice Class Reference
[Rules]

X-faced dice. More...

#include <Dice.hh>

List of all members.

Public Member Functions

 Dice (BaseRules *r)
 Dice contructor.
 ~Dice ()
 Standart destructor.
int roll (const std::string &msg, enum eDiceFaceNumber type=D6, int nb_dice=1)
 Roll dices of selected type, and print a debug to see which dice/result is used.
int roll (enum eRoll bb_roll_type, enum eDiceFaceNumber type=D6, int nb_dice=1)

Static Public Member Functions

static const char * stringify (enum eBlockDiceFace face)
 Get a stringified version of enum eBlockDiceFace.
static const char * stringify (enum eRoll roll)
 Get a stringified version of enum eRoll.

Detailed Description

X-faced dice.


Constructor & Destructor Documentation

Dice::Dice ( BaseRules r  ) 

Dice contructor.

Parameters:
r Pointer to Rules class.

Member Function Documentation

int Dice::roll ( const std::string &  msg,
enum eDiceFaceNumber  type = D6,
int  nb_dice = 1 
)

Roll dices of selected type, and print a debug to see which dice/result is used.

Parameters:
msg A debug message, printed.
type Type of dice(s) to roll.
nb_dice Number of dice to roll.
Returns:
A (maybe :p) random number, in the specified range.
Note:
if type == DBLOCK, only one dice can be rolled.
Predefined results are used, if any.

Referenced by SBall::bounce(), SPlayer::checkArmour(), SPlayer::prepareKickoff(), SBall::scatter(), and SBall::throwIn().


The documentation for this class was generated from the following files:
Generated on Mon Apr 5 21:17:32 2010 for Stechec/TBT by  doxygen 1.6.3