summaryrefslogtreecommitdiff
path: root/src/Model/Game.cpp
diff options
context:
space:
mode:
authormanzerbredes <loic.guegan_secondary@yahoo.fr>2015-05-04 14:00:54 +0200
committermanzerbredes <loic.guegan_secondary@yahoo.fr>2015-05-04 14:00:54 +0200
commit164d94eec1b88f0e9a466585b512fc8dca4c80ed (patch)
treed32f93d24a13a4be2eaf14559217c1fccdb5e6a9 /src/Model/Game.cpp
parent1bebaf0f924c83bfb5a91bafefcb69d98e3b8b05 (diff)
Add stats class, make a functionnal SFML game
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();