From e66011756340e03fe941723f762119ed78ec2402 Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 11 Feb 2023 16:50:09 +0100 Subject: Added ConstContext for drawing systems This whole ongoing refactoring process is meant to better understand relationships between Battle, Simulation and Systems. --- engine/src/Context.cpp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'engine/src/Context.cpp') diff --git a/engine/src/Context.cpp b/engine/src/Context.cpp index eeec938..8c81c89 100644 --- a/engine/src/Context.cpp +++ b/engine/src/Context.cpp @@ -3,6 +3,7 @@ #include #include +#include #include @@ -12,10 +13,30 @@ namespace engine { -Context::Context(entt::registry& registry_, entt::dispatcher& dispatcher_, Clock& clock_) : +Context::Context(entt::registry& registry_, entt::dispatcher& dispatcher_, Clock& clock_, Camera& camera_) : registry {registry_}, dispatcher {dispatcher_}, - clock {clock_} + clock {clock_}, + camera {camera_} +{ +} + + +Context::operator ConstContext() const +{ + return ConstContext{registry, dispatcher, clock, camera}; +} + + +ConstContext::ConstContext( + const entt::registry& registry_, + const entt::dispatcher& dispatcher_, + const Clock& clock_, + const Camera& camera_) : + registry {registry_}, + dispatcher {dispatcher_}, + clock {clock_}, + camera {camera_} { } -- cgit v1.1