(World) Fixed EntityHandle passed by value
Former-commit-id: c4b4b5cbb4d84110416a4493fc09e7b95e137bc6
This commit is contained in:
parent
fb148c1aa0
commit
40727cc0ca
|
|
@ -30,12 +30,12 @@ namespace Ndk
|
||||||
|
|
||||||
void Clear();
|
void Clear();
|
||||||
|
|
||||||
void KillEntity(EntityHandle entity);
|
void KillEntity(const EntityHandle& entity);
|
||||||
void KillEntities(const EntityList& list);
|
void KillEntities(const EntityList& list);
|
||||||
|
|
||||||
EntityHandle GetEntity(Entity::Id id);
|
EntityHandle GetEntity(Entity::Id id);
|
||||||
|
|
||||||
bool IsEntityValid(EntityHandle entity) const;
|
bool IsEntityValid(const EntityHandle& entity) const;
|
||||||
bool IsEntityIdValid(Entity::Id id) const;
|
bool IsEntityIdValid(Entity::Id id) const;
|
||||||
|
|
||||||
void Update();
|
void Update();
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ namespace Ndk
|
||||||
KillEntity(entity);
|
KillEntity(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool World::IsEntityValid(EntityHandle entity) const
|
inline bool World::IsEntityValid(const EntityHandle& entity) const
|
||||||
{
|
{
|
||||||
return entity.IsValid() && entity->GetWorld() == this && IsEntityIdValid(entity->GetId());
|
return entity.IsValid() && entity->GetWorld() == this && IsEntityIdValid(entity->GetId());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ namespace Ndk
|
||||||
m_killedEntities.clear();
|
m_killedEntities.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void World::KillEntity(EntityHandle entity)
|
void World::KillEntity(const EntityHandle& entity)
|
||||||
{
|
{
|
||||||
///DOC: Ignoré si l'entité est invalide
|
///DOC: Ignoré si l'entité est invalide
|
||||||
|
|
||||||
|
|
@ -77,7 +77,7 @@ namespace Ndk
|
||||||
{
|
{
|
||||||
for (unsigned int i = 0; i < m_killedEntities.size(); ++i)
|
for (unsigned int i = 0; i < m_killedEntities.size(); ++i)
|
||||||
{
|
{
|
||||||
EntityHandle entity = m_killedEntities[i];
|
const EntityHandle& entity = m_killedEntities[i];
|
||||||
|
|
||||||
for (unsigned int j = 0; j < m_aliveEntities.size(); ++j)
|
for (unsigned int j = 0; j < m_aliveEntities.size(); ++j)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue