From 6d8cb36adf824c49f50f2ee7cc831a5981922b5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Fri, 26 Sep 2025 18:39:07 +0200 Subject: [PATCH] Don't stop/start, just start. Took 29 minutes --- cockatrice/src/game/game_state.cpp | 11 +---------- cockatrice/src/game/game_state.h | 5 ----- 2 files changed, 1 insertion(+), 15 deletions(-) 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;