-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdice.h
46 lines (31 loc) · 821 Bytes
/
dice.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef TS_DICE_H
#define TS_DICE_H
#pragma warning(push, 0)
#include <QString>
#pragma warning(pop)
namespace ts
{
class Dice
{
public:
void init();
Dice();
explicit Dice( const QString& sDiceXdYplusZ );
Dice( const Dice& );
virtual ~Dice();
Dice& operator=( const Dice& );
int num() const { return m_num; }
int faces() const { return m_faces; }
int bonus() const { return m_bonus; }
void setNum( int new_value ) { m_num = new_value; }
void setFaces( int new_value ) { m_faces = new_value; }
void setBonus( int new_value ) { m_bonus = new_value; }
QString toString() const;
int roll() const;
protected:
int m_num;
int m_faces;
int m_bonus;
};
} // namespace ts
#endif // TS_DICE_H