OnComponentCreated nu eventbaserat

This commit is contained in:
Stiffly
2014-05-25 04:01:40 +02:00
parent ad902cb511
commit 072e4d4dbb
8 changed files with 32 additions and 13 deletions
+5 -5
View File
@@ -148,11 +148,11 @@ void World::AddComponent(EntityID entity, std::string componentType, std::shared
component->Entity = entity;
m_ComponentsOfType[componentType].push_back(component);
m_EntityComponents[entity][componentType] = component;
for (auto pair : m_Systems)
{
auto system = pair.second;
system->OnComponentCreated(componentType, component);
}
Events::ComponentCreated e;
e.Entity = entity;
e.Component = component;
m_EventBroker->Publish(e);
}
EntityID World::CloneEntity(EntityID entity, EntityID parent /* = 0 */)