Added GetEntityByName to EntityManager
This commit is contained in:
parent
7c59fb16bd
commit
f5f9b80490
|
@ -213,5 +213,14 @@ namespace SHADE
|
|||
return SHSerialization::DeserializeEntityToSceneFromString(data);
|
||||
}*/
|
||||
|
||||
|
||||
EntityID SHEntityManager::GetEntityByName(std::string const& name) noexcept
|
||||
{
|
||||
EntityID result = MAX_EID;
|
||||
for (auto& entity : entityVec)
|
||||
{
|
||||
if (entity->name == name)
|
||||
result = entity->GetEID();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -209,6 +209,8 @@ namespace SHADE
|
|||
|
||||
//static EntityID DuplicateEntity(EntityID eid) noexcept;
|
||||
|
||||
static EntityID GetEntityByName(std::string const& name) noexcept;
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue