Optimizations

This commit is contained in:
2014-03-13 14:01:15 +01:00
parent f8f9203141
commit b34d2d3dd0
10 changed files with 34 additions and 32 deletions
+3 -3
View File
@@ -60,7 +60,7 @@ public:
std::shared_ptr<T> AddComponent(EntityID entity, std::string componentType);
std::shared_ptr<Component> AddComponent(EntityID entity, std::string componentType);
template <class T>
std::shared_ptr<T> GetComponent(EntityID entity, std::string componentType);
T* GetComponent(EntityID entity, std::string componentType);
/*std::vector<EntityID> GetEntityChildren(EntityID entity);*/
@@ -117,9 +117,9 @@ std::shared_ptr<T> World::AddComponent(EntityID entity, std::string componentTyp
template <class T>
std::shared_ptr<T> World::GetComponent(EntityID entity, std::string componentType)
T* World::GetComponent(EntityID entity, std::string componentType)
{
return std::static_pointer_cast<T>(m_EntityComponents[entity][componentType]);
return (T*)m_EntityComponents[entity][componentType].get();
}
#endif // World_h__