Sdk/World: Inline GetEntity and KillEntity

This commit is contained in:
Lynix
2017-04-22 12:58:39 +02:00
parent c06db7d9c5
commit 0708531f6c
3 changed files with 39 additions and 38 deletions

View File

@@ -141,7 +141,7 @@ namespace Ndk
return EntityHandle::InvalidHandle;
}
EntityHandle clone = CreateEntity();
const EntityHandle& clone = CreateEntity();
const Nz::Bitset<>& componentBits = original->GetComponentBits();
for (std::size_t i = componentBits.FindFirst(); i != componentBits.npos; i = componentBits.FindNext(i))
@@ -153,40 +153,6 @@ namespace Ndk
return GetEntity(clone->GetId());
}
/*!
* \brief Kills an entity
*
* \param Pointer to the entity
*
* \remark No change is done if entity is invalid
*/
void World::KillEntity(Entity* entity)
{
if (IsEntityValid(entity))
m_killedEntities.UnboundedSet(entity->GetId(), true);
}
/*!
* \brief Gets an entity
* \return A constant reference to the modified entity
*
* \param id Identifier of the entity
*
* \remark Produces a NazaraError if entity identifier is not valid
*/
const EntityHandle& World::GetEntity(EntityId id)
{
if (IsEntityIdValid(id))
return m_entities[id].handle;
else
{
NazaraError("Invalid ID");
return EntityHandle::InvalidHandle;
}
}
/*!
* \brief Updates the world
*