From 489fa7f930689dc9ff271138e613a8d68d88ee45 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 20 Sep 2024 20:17:32 +0100 Subject: Add basic environment object Will hold world time/date, weather, location etc --- game/environment.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 game/environment.h (limited to 'game/environment.h') diff --git a/game/environment.h b/game/environment.h new file mode 100644 index 0000000..62eedb8 --- /dev/null +++ b/game/environment.h @@ -0,0 +1,16 @@ +#pragma once + +#include "worldobject.h" + +class SceneRenderer; +class SceneProvider; + +class Environment : public WorldObject { +public: + Environment(); + void tick(TickDuration elapsed) override; + void render(const SceneRenderer &, const SceneProvider &) const; + +private: + time_t worldTime; +}; -- cgit v1.2.3 From 9b3eff2ee85ca6627342cfbbe1ac3ba988dc377f Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 20 Sep 2024 20:27:51 +0100 Subject: Move getSunPos to Environment --- game/environment.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'game/environment.h') diff --git a/game/environment.h b/game/environment.h index 62eedb8..a6f3036 100644 --- a/game/environment.h +++ b/game/environment.h @@ -1,5 +1,6 @@ #pragma once +#include "config/types.h" #include "worldobject.h" class SceneRenderer; @@ -10,6 +11,7 @@ public: Environment(); void tick(TickDuration elapsed) override; void render(const SceneRenderer &, const SceneProvider &) const; + static Direction2D getSunPos(const Direction2D position, const time_t time); private: time_t worldTime; -- cgit v1.2.3