SystemFactory for dynamic creation and fetching of systems in a world.

This commit is contained in:
2014-03-09 03:37:39 +01:00
parent f767cdbc9c
commit c952953787
15 changed files with 218 additions and 100 deletions
+5 -2
View File
@@ -1,6 +1,7 @@
#ifndef System_h__
#define System_h__
#include "Factory.h"
#include "Entity.h"
#include "Component.h"
@@ -15,13 +16,15 @@ public:
// Called once per system every tick
virtual void Update(double dt) { }
// Called once for every entity in the world every tick
virtual void Update(double dt, EntityID entity, EntityID parent) { }
virtual void UpdateEntity(double dt, EntityID entity, EntityID parent) { }
// Called when a component is created
virtual void OnComponentCreated(std::string type, std:: shared_ptr<Component> component);
virtual void OnComponentCreated(std::string type, std:: shared_ptr<Component> component) { }
protected:
World* m_World;
};
class SystemFactory : public Factory<System*> { };
#endif // System_h__