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 -5
View File
@@ -1,16 +1,14 @@
#include "Common.h"
#include "Core/System.h"
class RaptorCopterSystem : public System
class RaptorCopterSystem : public PureSystem
{
public:
RaptorCopterSystem(EventBroker* eventBroker)
: System(eventBroker, "RaptorCopter")
: PureSystem(eventBroker, "RaptorCopter")
{ }
virtual void Initialize() { }
virtual void Update(World* world, ComponentWrapper& raptorCopter, double dt) override
virtual void UpdateComponent(World* world, ComponentWrapper& raptorCopter, double dt) override
{
ComponentWrapper& transform = world->GetComponent(raptorCopter.EntityID, "Transform");
(glm::vec3&)transform["Orientation"] += (float)(double)raptorCopter["Speed"] * (float)dt * (glm::vec3)raptorCopter["Axis"];