diff --git a/include/Engine/Core/System.h b/include/Engine/Core/System.h index c4a33d94..cb4ccc26 100644 --- a/include/Engine/Core/System.h +++ b/include/Engine/Core/System.h @@ -15,7 +15,6 @@ public: , m_ComponentType(componentType) { } - virtual void Initialize() { } virtual void Update(World* world, ComponentWrapper& component, double dt) = 0; protected: diff --git a/include/Engine/Core/SystemPipeline.h b/include/Engine/Core/SystemPipeline.h index a3dc4f36..e4b8bb1f 100644 --- a/include/Engine/Core/SystemPipeline.h +++ b/include/Engine/Core/SystemPipeline.h @@ -21,16 +21,6 @@ public: } } - void Initialize() - { - for (auto& pair : m_Systems) { - auto& systems = pair.second; - for (auto& system : systems) { - system->Initialize(); - } - } - } - template void AddSystem(Arguments... args) { diff --git a/include/Game/PlayerSystem.h b/include/Game/PlayerSystem.h index 5966bb24..789b7549 100644 --- a/include/Game/PlayerSystem.h +++ b/include/Game/PlayerSystem.h @@ -23,9 +23,11 @@ class PlayerSystem : public System public: PlayerSystem(EventBroker* eventBroker) : 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; private: diff --git a/src/Game/Game.cpp b/src/Game/Game.cpp index 21f93e41..9eafd887 100644 --- a/src/Game/Game.cpp +++ b/src/Game/Game.cpp @@ -52,8 +52,6 @@ Game::Game(int argc, char* argv[]) m_LastTime = glfwGetTime(); testIntialize(); - - m_SystemPipeline->Initialize(); } Game::~Game() diff --git a/src/Game/PlayerSystem.cpp b/src/Game/PlayerSystem.cpp index 17e18a9a..a7b60011 100644 --- a/src/Game/PlayerSystem.cpp +++ b/src/Game/PlayerSystem.cpp @@ -1,10 +1,5 @@ #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) {