From 212d591c31f4200b06d38e98b23c5c2bccde1772 Mon Sep 17 00:00:00 2001 From: Hop311 Date: Mon, 22 May 2023 10:26:37 +0100 Subject: Formatting / style cleanup --- src/openvic/GameAdvancementHook.hpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/openvic/GameAdvancementHook.hpp') diff --git a/src/openvic/GameAdvancementHook.hpp b/src/openvic/GameAdvancementHook.hpp index 5d904bc..59e43a4 100644 --- a/src/openvic/GameAdvancementHook.hpp +++ b/src/openvic/GameAdvancementHook.hpp @@ -5,25 +5,27 @@ #include namespace OpenVic { - //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; using RefreshFunction = std::function; 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 GAME_SPEEDS; - private: - std::chrono::time_point lastPolledTime; - //A function pointer that advances the simulation, intended to be a capturing lambda or something similar. May need to be reworked later + private: + using time_point_t = std::chrono::time_point; + + time_point_t lastPolledTime; + // 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); -- cgit v1.2.3-56-ga3b1