Diffstat (limited to 'noncore/games/oyatzee/oyatzee.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/oyatzee/oyatzee.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/noncore/games/oyatzee/oyatzee.h b/noncore/games/oyatzee/oyatzee.h index 01ab36d..65a18fc 100644 --- a/noncore/games/oyatzee/oyatzee.h +++ b/noncore/games/oyatzee/oyatzee.h | |||
@@ -1,56 +1,75 @@ | |||
1 | #ifndef WORDGAME_H | 1 | #ifndef WORDGAME_H |
2 | #define WORDGAME_H | 2 | #define WORDGAME_H |
3 | 3 | ||
4 | #include <qmainwindow.h> | 4 | #include <qmainwindow.h> |
5 | #include <qlabel.h> | 5 | #include <qlabel.h> |
6 | #include <qlist.h> | 6 | #include <qlist.h> |
7 | 7 | ||
8 | #include <stdlib.h> // rand() function | 8 | #include <stdlib.h> // rand() function |
9 | #include <qdatetime.h> // seed for rand() | 9 | #include <qdatetime.h> // seed for rand() |
10 | 10 | ||
11 | class Dice; | 11 | class Dice; |
12 | class Game; | 12 | class Game; |
13 | class Scoreboard; | 13 | class Scoreboard; |
14 | class DiceWidget; | 14 | class DiceWidget; |
15 | 15 | ||
16 | typedef QList<Dice> dicesList; | 16 | typedef QList<Dice> dicesList; |
17 | typedef QValueList<int> QValueListInt; | ||
17 | 18 | ||
18 | class OYatzee : public QMainWindow { | 19 | class OYatzee : public QMainWindow { |
19 | Q_OBJECT | 20 | Q_OBJECT |
20 | public: | 21 | public: |
21 | OYatzee( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 22 | OYatzee( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
22 | ~OYatzee(); | 23 | ~OYatzee(); |
23 | 24 | ||
24 | Game *g; | 25 | Game *g; |
25 | DiceWidget *dw; | 26 | DiceWidget *dw; |
26 | Scoreboard *sb; | 27 | Scoreboard *sb; |
27 | 28 | ||
29 | QValueListInt posibilities; | ||
28 | 30 | ||
29 | void setPlayerNumber( const int num ); | 31 | void setPlayerNumber( const int num ); |
30 | void setRoundsNumber( const int num ); | 32 | void setRoundsNumber( const int num ); |
33 | |||
34 | enum { | ||
35 | Ones=1, | ||
36 | Twos = 2, | ||
37 | Threes = 3, | ||
38 | Fours = 4, | ||
39 | Fives = 5, | ||
40 | Sixes = 6, | ||
41 | ThreeOfAKind = 7, //12444 | ||
42 | FourOfAKind = 8, //14444 | ||
43 | FullHouse = 9, //22555 | ||
44 | SStraight = 10, //13456 | ||
45 | LStraight = 11, //12345 | ||
46 | Yatzee = 12, //55555 | ||
47 | Chance = 13}; | ||
31 | 48 | ||
32 | public slots: | 49 | public slots: |
33 | void slotStartGame(); | 50 | void slotStartGame(); |
34 | void slotRollDices(); | 51 | void slotRollDices(); |
35 | 52 | ||
36 | private: | 53 | private: |
37 | int numOfPlayers; | 54 | int numOfPlayers; |
38 | int numOfRounds; | 55 | int numOfRounds; |
39 | 56 | ||
40 | void detectPosibilities(); | 57 | void detectPosibilities(); |
58 | void displayPossibilites(); | ||
59 | |||
41 | }; | 60 | }; |
42 | 61 | ||
43 | class Dice : public QFrame | 62 | class Dice : public QFrame |
44 | { | 63 | { |
45 | Q_OBJECT | 64 | Q_OBJECT |
46 | public: | 65 | public: |
47 | Dice( QWidget* parent = 0, const char* name = 0 ); | 66 | Dice( QWidget* parent = 0, const char* name = 0 ); |
48 | 67 | ||
49 | int Value; | 68 | int Value; |
50 | bool isSelected; | 69 | bool isSelected; |
51 | 70 | ||
52 | int hasValue(); | 71 | int hasValue(); |
53 | void roll(); | 72 | void roll(); |
54 | virtual void mousePressEvent( QMouseEvent* ); | 73 | virtual void mousePressEvent( QMouseEvent* ); |
55 | 74 | ||
56 | private slots: | 75 | private slots: |