aboutsummaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp
new file mode 100644
index 0000000..11a603b
--- /dev/null
+++ b/src/game.cpp
@@ -0,0 +1,27 @@
+#include "game.hpp"
+
+
+Game::Game(int s)
+{
+ size = s;
+ grid = new int*[size];
+ for (int i = 0; i < size; i++)
+ grid[i] = new int[size];
+}
+
+Game::~Game()
+{
+ for (int i = 0; i < size; i++)
+ delete []grid[i];
+ delete []grid;
+}
+
+int Game::getSize()
+{
+ return size;
+}
+
+int Game::at(int x, int y)
+{
+ return grid[y][x];
+}