diff --git a/cockatrice/src/game/game_state.cpp b/cockatrice/src/game/game_state.cpp index 718bee747..854878b92 100644 --- a/cockatrice/src/game/game_state.cpp +++ b/cockatrice/src/game/game_state.cpp @@ -18,6 +18,7 @@ GameState::GameState(AbstractGame *parent, gameTimer = new QTimer(this); gameTimer->setInterval(1000); connect(gameTimer, &QTimer::timeout, this, &GameState::incrementGameTime); + gameTimer->start(); } void GameState::incrementGameTime() @@ -37,14 +38,4 @@ void GameState::setGameTime(int _secondsElapsed) emit updateTimeElapsedLabel(QString::number(hours).rightJustified(2, '0') + ":" + QString::number(minutes).rightJustified(2, '0') + ":" + QString::number(seconds).rightJustified(2, '0')); -} - -void GameState::startGameTimer() -{ - gameTimer->start(); -} - -void GameState::stopGameTimer() -{ - gameTimer->stop(); } \ No newline at end of file diff --git a/cockatrice/src/game/game_state.h b/cockatrice/src/game/game_state.h index 3305596f0..6edf579b0 100644 --- a/cockatrice/src/game/game_state.h +++ b/cockatrice/src/game/game_state.h @@ -91,17 +91,12 @@ public: void onStartedChanged(bool _started) { if (_started) { - startGameTimer(); emit gameStarted(_started); } else { - stopGameTimer(); emit gameStopped(); } } - void startGameTimer(); - void stopGameTimer(); - void setGameStateKnown(bool known) { gameStateKnown = known;