summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Game/Game.cpp39
1 files changed, 38 insertions, 1 deletions
diff --git a/src/Game/Game.cpp b/src/Game/Game.cpp
index 8f5d5f0..df49c6d 100644
--- a/src/Game/Game.cpp
+++ b/src/Game/Game.cpp
@@ -4,4 +4,41 @@
#include <cstdlib>
#include <cstdio>
#include <iostream>
-#include <string> \ No newline at end of file
+#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;
+ }
+ }
+} \ No newline at end of file