(World) Added clear method

Former-commit-id: 54789542144a382c134042fa8050d06d3a80ca5d
This commit is contained in:
Lynix 2015-02-08 15:45:42 +01:00
parent 12824deba2
commit 266da016ad
2 changed files with 15 additions and 0 deletions

View File

@ -25,6 +25,8 @@ namespace Ndk
Entity CreateEntity();
EntityList CreateEntities(unsigned int count);
void Clear();
void KillEntity(Entity& entity);
void KillEntities(EntityList& list);

View File

@ -50,6 +50,19 @@ namespace Ndk
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)
{
if (IsEntityValid(entity))