summaryrefslogtreecommitdiff
path: root/Userland/Games/BrickGame
diff options
context:
space:
mode:
authorkleines Filmröllchen <filmroellchen@serenityos.org>2023-03-13 22:35:22 +0100
committerJelle Raaijmakers <jelle@gmta.nl>2023-05-24 23:18:07 +0200
commiteffcd080ca802515ddce8392c70df512b509f57c (patch)
treea04e9a7927ddc9103129c4aa0d8b4d88976f4720 /Userland/Games/BrickGame
parent82c681e44b57563074e5c12dc7e36134b36ae750 (diff)
downloadserenity-effcd080ca802515ddce8392c70df512b509f57c.zip
Userland: Remove remaining users of Duration::now_realtime()
This is a clear sign that they want to use a UnixDateTime instead. This also adds support for placing durations and date times into SQL databases via their millisecond offset to UTC.
Diffstat (limited to 'Userland/Games/BrickGame')
-rw-r--r--Userland/Games/BrickGame/BrickGame.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/Userland/Games/BrickGame/BrickGame.cpp b/Userland/Games/BrickGame/BrickGame.cpp
index b8532afa2c..7058453a5f 100644
--- a/Userland/Games/BrickGame/BrickGame.cpp
+++ b/Userland/Games/BrickGame/BrickGame.cpp
@@ -355,7 +355,7 @@ public:
break;
m_level = i;
}
- auto const now { Duration::now_realtime() };
+ auto const now { UnixDateTime::now() };
auto const delay = s_level_map[m_level].m_delay;
if (now - m_last_update > delay) {
m_last_update = now;
@@ -372,7 +372,7 @@ public:
m_block.random_shape();
m_next_block.random_shape();
update_shadow_hint_block();
- m_last_update = Duration::now_realtime();
+ m_last_update = UnixDateTime::now();
m_state = GameState::Active;
}
@@ -384,7 +384,8 @@ private:
unsigned m_level {};
unsigned m_score {};
GameState m_state { GameState::GameOver };
- Duration m_last_update {};
+ // FIXME: Should probably use a monotonic clock instead.
+ UnixDateTime m_last_update {};
struct LevelMap final {
unsigned const m_score;