summaryrefslogtreecommitdiff
path: root/src/Game/Game.cpp
blob: df49c6ded36204b74af57faef04b3002aca09e94 (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
38
39
40
41
42
43
44
#include "Game.hpp"
#include "../Utils/Utils.hpp"

#include <cstdlib>
#include <cstdio>
#include <iostream>
#include <string>

void Game::initDiff(int diff) {
    switch (diff) {
        case 0:
            boardWidth  = 9;
            boardHeight = 9;
            mines       = 9;
            break;
        case 1:
            boardWidth  = 16;
            boardHeight = 16;
            mines       = 12;
            break;
        case 2:
            boardWidth  = 30;
            boardHeight = 16;
            mines       = 16;
            break;
        case 3:
            std::cout << "Editing game parameters\n";
            break;
    }
}

void Game::initBoard() {
    for (int i = 0; i < boardHeight; i++) {
        for (int j = 0; j < boardWidth; j++) {
            bombMap[i][j] = rand() % 2;
        }
    }

    for (int i = 0; i < boardHeight; i++) {
        for (int j = 0; j < boardWidth; j++) {
            tileMap[i][j] = 0;
        }
    }
}