summaryrefslogtreecommitdiff
path: root/src/Model/Game.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Model/Game.cpp')
-rw-r--r--src/Model/Game.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/Model/Game.cpp b/src/Model/Game.cpp
index 32482b7..6039bc9 100644
--- a/src/Model/Game.cpp
+++ b/src/Model/Game.cpp
@@ -7,3 +7,43 @@ Game::Game() : m_grid(){
Game::~Game(){
}
+
+
+
+bool Game::swipe(kbdh::Direction direction){
+
+ switch(direction){
+
+ case kbdh::Left:
+ m_grid.swipeLeft();
+ break;
+ case kbdh::Right:
+ m_grid.swipeRight();
+ break;
+ case kbdh::Up:
+ m_grid.swipeUp();
+ break;
+ case kbdh::Down:
+ m_grid.swipeDown();
+ break;
+ }
+
+ return true;
+}
+
+
+void Game::coutGrid(){
+ std::cout << m_grid.description();
+}
+
+bool Game::isOver(){
+ return m_grid.isOver();
+}
+
+void Game::popRandomNumber(){
+ std::tuple<int, int> coord(m_grid.getRandomEmptyCellCoord());
+
+ int number=2;
+
+ m_grid.setCell(coord, number);
+}