-
Notifications
You must be signed in to change notification settings - Fork 0
/
board.h
63 lines (41 loc) · 1.11 KB
/
board.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef BOARD_H
#define BOARD_H
#include "SDL.h"
#include "constant.h"
#include "LTexture.h"
#include "LevelSelect.h"
#include "LMusic.h"
#include <sstream>
extern LevelSelect gLevelSelect;
extern LMusic gMusic;
class Board{
public:
static const int CELL_SIZE = 30;
static const int NUM_OF_COL = 20;
static const int NUM_OF_ROW = 20;
Board();
bool loadTexture();
void generateBoard();
void renderBoard();
void openCell(int row, int col);
void placeFlag(int row, int col);
void revealBomb();
void handleEvent(SDL_Event& e);
int getBombRemaining();
bool checkFlagPlaced();
bool bombActivated();
void free();
private:
int gBoard[NUM_OF_ROW][NUM_OF_COL];
int gBoardShown[NUM_OF_ROW][NUM_OF_COL];
int NUM_OF_BOMB;
LTexture gNormal;
LTexture gBomb;
LTexture gNumber[MAX_NUMBER_IN_CELL];
LTexture gFlag;
LTexture gBombText;
int bombRemaining;
int flagPlaced;
bool bombIsActivated;
};
#endif