aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author BrickPi <49528459+BrickPi@users.noreply.github.com>2023-05-07 19:41:44 +0200
committer GitHub <noreply@github.com>2023-05-07 19:41:44 +0200
commit1838e79d6af83dbed2f1b387acf02aacca0eb4bc (patch)
treefb08e98d1940bef44e02935e63578e2ce47581c1
parent64bbf86b623a3cca2eaf9009d7acdcde067592e3 (diff)
Implement session start (SS-54) (#1)
-rw-r--r--src/openvic2/GameManager.cpp1
-rw-r--r--src/openvic2/GameManager.hpp1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/openvic2/GameManager.cpp b/src/openvic2/GameManager.cpp
index 58e40bb..da775ba 100644
--- a/src/openvic2/GameManager.cpp
+++ b/src/openvic2/GameManager.cpp
@@ -28,6 +28,7 @@ void GameManager::tick() {
}
return_t GameManager::setup() {
+ session_start = time(nullptr);
clock.reset();
today = { 1836 };
set_needs_update();
diff --git a/src/openvic2/GameManager.hpp b/src/openvic2/GameManager.hpp
index 70e98bd..fc5d344 100644
--- a/src/openvic2/GameManager.hpp
+++ b/src/openvic2/GameManager.hpp
@@ -10,6 +10,7 @@ namespace OpenVic2 {
Map map;
BuildingManager building_manager;
GameAdvancementHook clock;
+ time_t session_start; /* SS-54, as well as allowing time-tracking */
private:
Date today;
state_updated_func_t state_updated;