Added support for "Impure" systems, which only update once per frame and contain their own logic for manipulating the world, instead of relying on a single list of components.

This commit is contained in:
2015-12-13 13:37:14 +01:00
parent 2e321e15a5
commit 8a6030bf57
5 changed files with 60 additions and 28 deletions
+3 -3
View File
@@ -18,17 +18,17 @@ struct KeyInput
bool Right = false;
};
class PlayerSystem : public System
class PlayerSystem : public PureSystem
{
public:
PlayerSystem(EventBroker* eventBroker)
: System(eventBroker, "Player")
: PureSystem(eventBroker, "Player")
{
EVENT_SUBSCRIBE_MEMBER(m_EKeyDown, &PlayerSystem::OnKeyDown);
EVENT_SUBSCRIBE_MEMBER(m_EKeyUp, &PlayerSystem::OnKeyUp);
}
virtual void Update(World* world, ComponentWrapper& player, double dt) override;
virtual void UpdateComponent(World* world, ComponentWrapper& player, double dt) override;
private:
float m_Speed = 5;