(World) Added DOC comments
Former-commit-id: 211735ec2cf553b991f95b210af5e7e451ab4f1f
This commit is contained in:
parent
266da016ad
commit
5fb728d0be
|
|
@ -65,6 +65,8 @@ namespace Ndk
|
||||||
|
|
||||||
void World::KillEntity(Entity& entity)
|
void World::KillEntity(Entity& entity)
|
||||||
{
|
{
|
||||||
|
///DOC: Ignoré si l'entité est invalide
|
||||||
|
|
||||||
if (IsEntityValid(entity))
|
if (IsEntityValid(entity))
|
||||||
m_killedEntities.push_back(entity);
|
m_killedEntities.push_back(entity);
|
||||||
}
|
}
|
||||||
|
|
@ -89,11 +91,15 @@ namespace Ndk
|
||||||
|
|
||||||
bool World::IsEntityValid(const Entity& entity) const
|
bool World::IsEntityValid(const Entity& entity) const
|
||||||
{
|
{
|
||||||
|
///DOC: Cette méthode vérifie également l'appartenance de l'entité au monde (et est donc plus sûre)
|
||||||
return entity.GetWorld() == this && IsEntityIdValid(entity.GetId());
|
return entity.GetWorld() == this && IsEntityIdValid(entity.GetId());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool World::IsEntityIdValid(Entity::Id id) const
|
bool World::IsEntityIdValid(Entity::Id id) const
|
||||||
{
|
{
|
||||||
|
///DOC: Il est possible que si l'identifiant vienne d'un autre monde, il soit considéré valide
|
||||||
|
/// alors qu'aucune entité de ce monde-ci ne l'utilise (encore)
|
||||||
|
|
||||||
return m_entitiesCounter[id.part.index] == id.part.counter;
|
return m_entitiesCounter[id.part.index] == id.part.counter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue