Removed Initialize function for systems.
This commit is contained in:
@@ -15,7 +15,6 @@ public:
|
||||
, m_ComponentType(componentType)
|
||||
{ }
|
||||
|
||||
virtual void Initialize() { }
|
||||
virtual void Update(World* world, ComponentWrapper& component, double dt) = 0;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -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>
|
||||
void AddSystem(Arguments... args)
|
||||
{
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -52,8 +52,6 @@ Game::Game(int argc, char* argv[])
|
||||
m_LastTime = glfwGetTime();
|
||||
|
||||
testIntialize();
|
||||
|
||||
m_SystemPipeline->Initialize();
|
||||
}
|
||||
|
||||
Game::~Game()
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user