Refactored factory and component system.

This commit is contained in:
2014-03-07 01:08:54 +01:00
parent 18197bf21d
commit e65db077d5
30 changed files with 313 additions and 284 deletions
+16 -1
View File
@@ -84,4 +84,19 @@ World::World()
m_LastEntityID = 0;
m_Systems.push_back(std::make_shared<Systems::Collision>(this));
}
RegisterComponents();
RegisterSystems();
}
void World::RegisterComponents()
{
m_ComponentFactory.Register("Transform", []() { return new Components::Transform(); });
m_ComponentFactory.Register("Input", []() { return new Components::Input(); });
m_ComponentFactory.Register("DirectionalLight", []() { return new Components::DirectionalLight(); });
}
void World::RegisterSystems()
{
}