Merge pull request #135 from SHADE-DP/SP3-5-ECS
Sp3 5 ecs Added GetEntityByName to EntityManager. Defaults to MAX_EID if none are found.
This commit is contained in:
commit
2a31ea6798
|
@ -213,5 +213,14 @@ namespace SHADE
|
||||||
return SHSerialization::DeserializeEntityToSceneFromString(data);
|
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 DuplicateEntity(EntityID eid) noexcept;
|
||||||
|
|
||||||
|
static EntityID GetEntityByName(std::string const& name) noexcept;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue