(World) Added clear method
Former-commit-id: 54789542144a382c134042fa8050d06d3a80ca5d
This commit is contained in:
parent
12824deba2
commit
266da016ad
|
|
@ -25,6 +25,8 @@ namespace Ndk
|
||||||
Entity CreateEntity();
|
Entity CreateEntity();
|
||||||
EntityList CreateEntities(unsigned int count);
|
EntityList CreateEntities(unsigned int count);
|
||||||
|
|
||||||
|
void Clear();
|
||||||
|
|
||||||
void KillEntity(Entity& entity);
|
void KillEntity(Entity& entity);
|
||||||
void KillEntities(EntityList& list);
|
void KillEntities(EntityList& list);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,19 @@ namespace Ndk
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void World::Clear()
|
||||||
|
{
|
||||||
|
///DOC: Les handles existants avant Clear ne sont plus garantis de ne pas être réutilisés
|
||||||
|
/// et devraient être détruits avant la création d'une nouvelle entité.
|
||||||
|
|
||||||
|
m_aliveEntities.clear();
|
||||||
|
m_entitiesCounter.clear();
|
||||||
|
m_freeIdList.clear();
|
||||||
|
m_killedEntities.clear();
|
||||||
|
|
||||||
|
m_nextIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
void World::KillEntity(Entity& entity)
|
void World::KillEntity(Entity& entity)
|
||||||
{
|
{
|
||||||
if (IsEntityValid(entity))
|
if (IsEntityValid(entity))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue