aboutsummaryrefslogtreecommitdiff
path: root/src/game/game.hpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-06-03 12:02:11 +0200
committerHampusM <hampus@hampusmat.com>2022-06-13 17:57:00 +0200
commitdf49c32fc0792214182d510b4a58c524bf8b59c5 (patch)
treefb626b5bdb359bca08a85d8d8fefb1679b4e61ab /src/game/game.hpp
parent4f27cc4f86fb7265bc6ad78cdfbe5d858a92a56e (diff)
feat: add ability to change generation speed
Diffstat (limited to 'src/game/game.hpp')
-rw-r--r--src/game/game.hpp7
1 files changed, 6 insertions, 1 deletions
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 <list>
#include <memory>
-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<Vector2> _living_cell_positions;
void _move_cursor(const Vector2 &direction) noexcept;