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.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/Model/Game.cpp b/src/Model/Game.cpp
index 9c67184..5781f54 100644
--- a/src/Model/Game.cpp
+++ b/src/Model/Game.cpp
@@ -4,7 +4,7 @@
//==================== Constructor and Destructor ====================
//Constructor
-Game::Game() : Grid(), m_nbMove(0), m_score(0){
+Game::Game() : Grid(), m_stats(){
}
//Destructor
@@ -35,8 +35,8 @@ bool Game::swipe(kbdh::Direction direction){
}
if(moveDone){
- m_score+=m_lastMoveScore;
- m_nbMove++;
+ m_stats.incScore(m_lastMoveScore);
+ m_stats.incnbMove();
this->popRandomNumber();
}
@@ -75,14 +75,10 @@ void Game::popRandomNumber(){
//==================== Getters and Setter ====================
//Retrieve the Score
-int Game::getScore(){
- return m_score;
+Stats Game::getStats(){
+ return m_stats;
}
-//Retrieve the number of moves
-int Game::getNbMove(){
- return m_nbMove;
-}
//std::vector<std::vector<int> > Game::getGrid(){
//return m_grid.getGrid();