author | zecke <zecke> | 2004-10-15 01:48:45 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-10-15 01:48:45 (UTC) |
commit | fefeafe35f8dac30f4baab9e3bff8e2ffbd1afd0 (patch) (unidiff) | |
tree | a59a3bd9b5434657ee014dd6bbf7fbb50f5994d0 /noncore/games/zsame/StoneField.h | |
parent | 85ab1a8cc3935538cc1f33fef7c94ba31accb53e (diff) | |
download | opie-fefeafe35f8dac30f4baab9e3bff8e2ffbd1afd0.zip opie-fefeafe35f8dac30f4baab9e3bff8e2ffbd1afd0.tar.gz opie-fefeafe35f8dac30f4baab9e3bff8e2ffbd1afd0.tar.bz2 |
Fix #1450 to clear the 'bonus' for removing every stone in the game
Diffstat (limited to 'noncore/games/zsame/StoneField.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/zsame/StoneField.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/games/zsame/StoneField.h b/noncore/games/zsame/StoneField.h index 80be73a..d32d78d 100644 --- a/noncore/games/zsame/StoneField.h +++ b/noncore/games/zsame/StoneField.h | |||
@@ -46,68 +46,69 @@ private: | |||
46 | public: | 46 | public: |
47 | StoneFieldState(const StoneField &stonefield); | 47 | StoneFieldState(const StoneField &stonefield); |
48 | ~StoneFieldState(); | 48 | ~StoneFieldState(); |
49 | void restore(StoneField &stonefield) const; | 49 | void restore(StoneField &stonefield) const; |
50 | }; | 50 | }; |
51 | 51 | ||
52 | 52 | ||
53 | class StoneField { | 53 | class StoneField { |
54 | friend class StoneFieldState; | 54 | friend class StoneFieldState; |
55 | friend class StoneWidget; | 55 | friend class StoneWidget; |
56 | private: | 56 | private: |
57 | 57 | ||
58 | int sizex; | 58 | int sizex; |
59 | int sizey; | 59 | int sizey; |
60 | int maxstone; | 60 | int maxstone; |
61 | 61 | ||
62 | struct Stone *field; | 62 | struct Stone *field; |
63 | 63 | ||
64 | int colors; | 64 | int colors; |
65 | unsigned int board; | 65 | unsigned int board; |
66 | unsigned int score; | 66 | unsigned int score; |
67 | mutable int gameover; | 67 | mutable int gameover; |
68 | bool m_gotBonus; | 68 | bool m_gotBonus; |
69 | int marked; | 69 | int marked; |
70 | 70 | ||
71 | KRandomSequence random; | 71 | KRandomSequence random; |
72 | QList<StoneFieldState> *undolist; | 72 | QList<StoneFieldState> *undolist; |
73 | public: | 73 | public: |
74 | StoneField(int width=15,int height=10, | 74 | StoneField(int width=15,int height=10, |
75 | int colors=3,unsigned int board=0, | 75 | int colors=3,unsigned int board=0, |
76 | bool undoenabled=true); | 76 | bool undoenabled=true); |
77 | ~StoneField(); | 77 | ~StoneField(); |
78 | 78 | ||
79 | int width() const; | 79 | int width() const; |
80 | int height() const; | 80 | int height() const; |
81 | 81 | ||
82 | void newGame(unsigned int board,int colors); | 82 | void newGame(unsigned int board,int colors); |
83 | 83 | ||
84 | void reset(); | 84 | void reset(); |
85 | 85 | ||
86 | 86 | ||
87 | int mark(int x,int y,bool force=false); | 87 | int mark(int x,int y,bool force=false); |
88 | void unmark(); | 88 | void unmark(); |
89 | 89 | ||
90 | int remove(int x,int y,bool force=false); | 90 | int remove(int x,int y,bool force=false); |
91 | 91 | ||
92 | int undo(int count=1); | 92 | int undo(int count=1); |
93 | 93 | ||
94 | bool isGameover() const; | 94 | bool isGameover() const; |
95 | bool gotBonus() const; | 95 | bool gotBonus() const; |
96 | void clearBonus(); | ||
96 | bool undoPossible() const; | 97 | bool undoPossible() const; |
97 | int getBoard() const; | 98 | int getBoard() const; |
98 | int getScore() const; | 99 | int getScore() const; |
99 | int getColors() const; | 100 | int getColors() const; |
100 | int getMarked() const; | 101 | int getMarked() const; |
101 | 102 | ||
102 | protected: | 103 | protected: |
103 | int getFieldSize() const; | 104 | int getFieldSize() const; |
104 | struct Stone *getField() const; | 105 | struct Stone *getField() const; |
105 | 106 | ||
106 | int map(int x,int y); | 107 | int map(int x,int y); |
107 | void mark(int index,unsigned char color); | 108 | void mark(int index,unsigned char color); |
108 | }; | 109 | }; |
109 | 110 | ||
110 | #endif | 111 | #endif |
111 | 112 | ||
112 | 113 | ||
113 | 114 | ||