Removed Initialize function for systems.

This commit is contained in:
stiffly
2015-12-11 15:23:56 +01:00
parent 4da33ff4ec
commit 16d636a87c
5 changed files with 4 additions and 20 deletions
-1
View File
@@ -15,7 +15,6 @@ public:
, m_ComponentType(componentType) , m_ComponentType(componentType)
{ } { }
virtual void Initialize() { }
virtual void Update(World* world, ComponentWrapper& component, double dt) = 0; virtual void Update(World* world, ComponentWrapper& component, double dt) = 0;
protected: protected:
-10
View File
@@ -21,16 +21,6 @@ public:
} }
} }
void Initialize()
{
for (auto& pair : m_Systems) {
auto& systems = pair.second;
for (auto& system : systems) {
system->Initialize();
}
}
}
template <typename T, typename... Arguments> template <typename T, typename... Arguments>
void AddSystem(Arguments... args) void AddSystem(Arguments... args)
{ {
+4 -2
View File
@@ -23,9 +23,11 @@ class PlayerSystem : public System
public: public:
PlayerSystem(EventBroker* eventBroker) PlayerSystem(EventBroker* eventBroker)
: System(eventBroker, "Player") : System(eventBroker, "Player")
{ } {
EVENT_SUBSCRIBE_MEMBER(m_EKeyDown, &PlayerSystem::OnKeyDown);
EVENT_SUBSCRIBE_MEMBER(m_EKeyUp, &PlayerSystem::OnKeyUp);
}
virtual void Initialize();
virtual void Update(World* world, ComponentWrapper& player, double dt) override; virtual void Update(World* world, ComponentWrapper& player, double dt) override;
private: private:
-2
View File
@@ -52,8 +52,6 @@ Game::Game(int argc, char* argv[])
m_LastTime = glfwGetTime(); m_LastTime = glfwGetTime();
testIntialize(); testIntialize();
m_SystemPipeline->Initialize();
} }
Game::~Game() Game::~Game()
-5
View File
@@ -1,10 +1,5 @@
#include "PlayerSystem.h" #include "PlayerSystem.h"
void PlayerSystem::Initialize()
{
EVENT_SUBSCRIBE_MEMBER(m_EKeyDown, &PlayerSystem::OnKeyDown);
EVENT_SUBSCRIBE_MEMBER(m_EKeyUp, &PlayerSystem::OnKeyUp);
}
void PlayerSystem::Update(World * world, ComponentWrapper & player, double dt) void PlayerSystem::Update(World * world, ComponentWrapper & player, double dt)
{ {