From 1400ade977e13e3b535d3c2fddb6e15de3c9b5a5 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Thu, 8 Feb 2018 13:43:10 -0500 Subject: Moved sprite rendering into AnimatingSystem Refactored how systems work slightly. Now, rendering can be done by a number of systems working together. Since the AnimatingSystem handles the animation of sprites, it should also handle the rendering of them. Because of this, the RenderingSystem has been removed. --- src/system_manager.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/system_manager.h') diff --git a/src/system_manager.h b/src/system_manager.h index e2c98cb..b03c3f2 100644 --- a/src/system_manager.h +++ b/src/system_manager.h @@ -39,6 +39,30 @@ public: return *dynamic_cast(systems[systemType]); } + void tick(double dt) + { + for (std::unique_ptr& sys : loop) + { + sys->tick(dt); + } + } + + virtual void render(Texture& texture) + { + for (std::unique_ptr& sys : loop) + { + sys->render(texture); + } + } + + virtual void input(int key, int action) + { + for (std::unique_ptr& sys : loop) + { + sys->input(key, action); + } + } + }; #endif /* end of include guard: SYSTEM_MANAGER_H_544E6056 */ -- cgit 1.4.1