This repository was archived by the owner on Feb 3, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGrid.h
More file actions
57 lines (48 loc) · 1.29 KB
/
Grid.h
File metadata and controls
57 lines (48 loc) · 1.29 KB
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
#pragma once
#include "myconio.h"
#include "Cell.h"
#include "Settings.h"
#include <string>
#include "Timer.h"
class Grid{
public:
Grid(Difficulty dif = Beginner, std::string label = "M I N E S W E E P E R");
~Grid();
Cell* getCell(int x, int y) const;
void moveCursor(int pushX, int pushY);
void switchFlag();
bool checkField();
bool checkWon() const;
void update();
void switchDevTools();
void switchShowBomb();
void restart();
void setLabel(std::string label);
std::string getLabel() const;
void render() const;
private:
Cell* *board;
Timer timer;
int currentX;
int currentY;
Settings sett;
int rightBombCounter;
int flagCounter;
int openFieldCounter;
bool showCursor;
bool showDevTools;
bool showAllBombs;
bool firstBomb;
std::string label;
int getIndex(int x, int y) const;
bool inRange(int x, int y) const;
void drawBox(int x, int y, int color = GREEN, int bgC = GREEN, char sign = 219, int number = -1) const;
void drawNumber(int x, int y, int number) const;
void setRandomMines();
int countBombs(int x, int y) const;
void showBombs(bool state);
void openFields(int x, int y);
void setNumbers();
void displayLabel() const;
void displayDevTools() const;
};