]>
git.saurik.com Git - wxWidgets.git/blob - demos/bombs/game.h
1 //---------------------------------------------------------------
3 // Definition of the class BombsGame, containing the data for a
5 //---------------------------------------------------------------
9 #define BG_HIDDEN 0x100
11 #define BG_MARKED 0x400
12 #define BG_EXPLODED 0x800
22 int bombs
,normal_cells
;
24 BombsGame() { width
=height
=0; field
=NULL
; };
26 int Init(int width
, int height
);
27 int GetWidth() { return width
; };
28 int GetHeight() { return height
; };
29 int Get(int x
, int y
) { return field
[x
+y
*width
]; };
30 void Mark(int x
, int y
);
31 void Unhide(int x
, int y
);
32 void Explode(int x
, int y
);
33 int IsHidden(int x
, int y
) { return Get(x
,y
) & BG_HIDDEN
; };
34 int IsMarked(int x
, int y
) { return Get(x
,y
) & BG_MARKED
; };
35 int IsBomb(int x
, int y
) { return Get(x
,y
) & BG_BOMB
; };
36 int IsExploded(int x
, int y
) { return Get(x
,y
) & BG_EXPLODED
; };
37 int GetBombs() { return bombs
; };
38 int GetRemainingCells() { return normal_cells
; };
41 #endif /* def GAME_H */