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.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/Model/Game.cpp b/src/Model/Game.cpp
index 2ac665f..d75fa32 100644
--- a/src/Model/Game.cpp
+++ b/src/Model/Game.cpp
@@ -2,7 +2,7 @@
-Game::Game() : m_grid(){
+Game::Game() : m_grid(), m_score(0), m_nbMove(0){
}
Game::~Game(){
@@ -30,8 +30,11 @@ bool Game::swipe(kbdh::Direction direction){
break;
}
- if(moveDone)
+ if(moveDone){
+ m_score+=m_grid.getLastMoveScore();
+ m_nbMove++;
this->popRandomNumber();
+ }
return moveDone;
}
@@ -62,3 +65,11 @@ void Game::popRandomNumber(){
m_grid.setCell(coord, number);
}
+
+int Game::getScore(){
+ return m_score;
+}
+
+int Game::getNbMove(){
+ return m_nbMove;
+}