summaryrefslogtreecommitdiff
path: root/src/Game.hpp
blob: 9b720a9d0bd9092d0d3b0d2db2756133d8c86fdc (plain)
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
#include <string>

#pragma once

class Game {
private:
    static constexpr int MAX_W = 32;
    static constexpr int MAX_H = 32;

    int boardWidth;
    int boardHeight;

    bool bombMap[MAX_H][MAX_W];
    int tileMap[MAX_H][MAX_W];
    bool revealedMap[MAX_H][MAX_W];
    bool flagMap[MAX_H][MAX_W];

    int mines;
    
    std::string msg;
    
public:
    bool inGame;
    bool hasWon();

    int editDiff();
    void initDiff(int diff);
    void initBoard();
    void updateBoard();
    void displayBoard();

    int bombCheck(int x, int y);

    void revealTile(int y, int x);
    void input();
};