aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic2/GameAdvancementHook.hpp
diff options
context:
space:
mode:
author George L. Albany <Megacake1234@gmail.com>2023-05-02 11:25:32 +0200
committer GitHub <noreply@github.com>2023-05-02 11:25:32 +0200
commit9f772a314dc130df95fe5e3b018a9ba60e5be5b1 (patch)
treeab138ae3c615adeb51972b4bfff992dea86cd69c /extension/src/openvic2/GameAdvancementHook.hpp
parentbe43b260128664756054a289cf9d22319def1f8a (diff)
parent112de0ac9c7ce26bd75d06e4cd3bc91adee716e3 (diff)
Merge pull request #97 from Spartan322/update/clang-format
Diffstat (limited to 'extension/src/openvic2/GameAdvancementHook.hpp')
-rw-r--r--extension/src/openvic2/GameAdvancementHook.hpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/extension/src/openvic2/GameAdvancementHook.hpp b/extension/src/openvic2/GameAdvancementHook.hpp
index 07f8414..1fe7737 100644
--- a/extension/src/openvic2/GameAdvancementHook.hpp
+++ b/extension/src/openvic2/GameAdvancementHook.hpp
@@ -5,25 +5,25 @@
#include <vector>
namespace OpenVic2 {
- //Conditionally advances game with provided behaviour
- //Class governs game speed and pause state
+ // Conditionally advances game with provided behaviour
+ // Class governs game speed and pause state
class GameAdvancementHook {
- public:
+ public:
using AdvancementFunction = std::function<void()>;
using RefreshFunction = std::function<void()>;
using speed_t = int8_t;
- //Minimum number of miliseconds before the simulation advances
+ // Minimum number of miliseconds before the simulation advances
static const std::vector<std::chrono::milliseconds> GAME_SPEEDS;
- private:
+ private:
std::chrono::time_point<std::chrono::high_resolution_clock> lastPolledTime;
- //A function pointer that advances the simulation, intended to be a capturing lambda or something similar. May need to be reworked later
+ // A function pointer that advances the simulation, intended to be a capturing lambda or something similar. May need to be reworked later
AdvancementFunction triggerFunction;
RefreshFunction refreshFunction;
speed_t currentSpeed;
- public:
+ public:
bool isPaused;
GameAdvancementHook(AdvancementFunction tickFunction, RefreshFunction updateFunction, bool startPaused = true, speed_t startingSpeed = 0);