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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user