From df49c32fc0792214182d510b4a58c524bf8b59c5 Mon Sep 17 00:00:00 2001 From: HampusM Date: Fri, 3 Jun 2022 12:02:11 +0200 Subject: feat: add ability to change generation speed --- src/game/game.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/game/game.hpp') diff --git a/src/game/game.hpp b/src/game/game.hpp index 7e43c7c..b5b69cf 100644 --- a/src/game/game.hpp +++ b/src/game/game.hpp @@ -16,7 +16,10 @@ #include #include -constexpr auto GENERATION_UPDATE_SPEED_MILLIS = 200; +constexpr auto DEFAULT_MIN_TIME_SINCE_LAST_GEN_MILLIS = 200; + +constexpr auto MIN_TIME_SINCE_LAST_GEN_INCREMENT = 50; +constexpr auto MIN_TIME_SINCE_LAST_GEN_DECREMENT = 50; class Game : public IGame { @@ -48,6 +51,8 @@ private: TimePoint _last_update_time; TimePoint _last_gen_update_time; + int32_t _min_time_since_last_gen_millis = DEFAULT_MIN_TIME_SINCE_LAST_GEN_MILLIS; + std::list _living_cell_positions; void _move_cursor(const Vector2 &direction) noexcept; -- cgit v1.2.3-18-g5258