untrack destroyed entities
parent
936b97c4ec
commit
05fa578652
|
@ -718,5 +718,10 @@ namespace Encompass
|
|||
withMask.Not()
|
||||
);
|
||||
}
|
||||
|
||||
internal void RegisterDestroyedEntity(Entity entity)
|
||||
{
|
||||
_trackedEntities.Remove(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,10 +64,11 @@ namespace Encompass
|
|||
entitiesMarkedForDestroy.Add(entity);
|
||||
}
|
||||
|
||||
public void DestroyMarkedEntities()
|
||||
public void DestroyMarkedEntities(IEnumerable<Engine> engines)
|
||||
{
|
||||
foreach (var entity in entitiesMarkedForDestroy)
|
||||
{
|
||||
foreach (var engine in engines) { engine.RegisterDestroyedEntity(entity); }
|
||||
componentManager.MarkAllComponentsOnEntityForRemoval(entity);
|
||||
IDs.Remove(entity.ID);
|
||||
idManager.Free(entity.ID);
|
||||
|
|
|
@ -70,7 +70,6 @@ namespace Encompass
|
|||
foreach (var engine in _componentTypesToEngines[componentType])
|
||||
{
|
||||
_pairsToCheck.Add((entity, engine));
|
||||
// engine.CheckTrackEntity(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -83,7 +82,6 @@ namespace Encompass
|
|||
foreach (var engine in _componentTypesToEngines[componentType])
|
||||
{
|
||||
_pairsToCheck.Add((entity, engine));
|
||||
//engine.CheckUntrackEntity(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ namespace Encompass
|
|||
}
|
||||
|
||||
messageManager.ClearMessages();
|
||||
entityManager.DestroyMarkedEntities();
|
||||
entityManager.DestroyMarkedEntities(enginesInOrder);
|
||||
|
||||
componentManager.WriteComponents();
|
||||
componentManager.RemoveMarkedComponents();
|
||||
|
|
|
@ -48,12 +48,12 @@ namespace Encompass
|
|||
this.entityCapacity = entityCapacity;
|
||||
drawLayerManager = new DrawLayerManager(typeToIndex);
|
||||
timeManager = new TimeManager();
|
||||
trackingManager = new TrackingManager();
|
||||
componentUpdateManager = new ComponentUpdateManager(typeToIndex);
|
||||
componentManager = new ComponentManager(drawLayerManager, componentUpdateManager, typeToIndex);
|
||||
messageManager = new MessageManager(timeManager);
|
||||
entityManager = new EntityManager(componentManager, entityCapacity);
|
||||
renderManager = new RenderManager(entityManager, drawLayerManager);
|
||||
trackingManager = new TrackingManager();
|
||||
|
||||
startingComponentStoreForComponentManager = new ComponentStore(typeToIndex);
|
||||
startingComponentStoreForComponentUpdateManager = new ComponentStore(typeToIndex);
|
||||
|
@ -419,9 +419,9 @@ namespace Encompass
|
|||
var dummyTimeManager = new TimeManager();
|
||||
var dummyMessageManager = new MessageManager(dummyTimeManager);
|
||||
var dummyDrawLayerManager = new DrawLayerManager(typeToIndex);
|
||||
var dummyTrackingManager = new TrackingManager();
|
||||
var dummyComponentUpdateManager = new ComponentUpdateManager(typeToIndex);
|
||||
var dummyComponentManager = new ComponentManager(dummyDrawLayerManager, dummyComponentUpdateManager, typeToIndex);
|
||||
var dummyTrackingManager = new TrackingManager();
|
||||
var dummyEntityManager = new EntityManager(dummyComponentManager, entityCapacity);
|
||||
var dummyRenderManager = new RenderManager(dummyEntityManager, dummyDrawLayerManager);
|
||||
|
||||
|
|
Loading…
Reference in New Issue