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.h | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'src/system.h') diff --git a/src/system.h b/src/system.h index 6a3cd14..e630c48 100644 --- a/src/system.h +++ b/src/system.h @@ -4,6 +4,7 @@ #include "entity_manager.h" class Game; +class Texture; class System { public: @@ -16,7 +17,35 @@ public: virtual ~System() = default; - virtual void tick(double dt) = 0; + /** + * Updates the state of a system. + * + * @param dt - The amount of time in seconds that have passed since the last + * update. + */ + virtual void tick(double) + { + } + + /** + * Renders to a texture. + * + * @param texture - The surface to render to. + */ + virtual void render(Texture&) + { + } + + /** + * Processes keyboard input. + * + * @param key - The relevant key. + * + * @param action - The action performed (press, released, etc). + */ + virtual void input(int, int) + { + } protected: -- cgit 1.4.1