mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-25 16:35:33 +00:00
removed the old ecs and refactored the platformer demo to use the new ecs
This commit is contained in:
@@ -20,9 +20,16 @@ namespace MonoGame.Extended.Entities.Systems
|
||||
{
|
||||
_world = value;
|
||||
_subscription = new EntitySubscription(_world.EntityManager, _aspectBuilder.Build(_world.ComponentManager));
|
||||
|
||||
// TODO: Undisposed events.
|
||||
_world.EntityManager.EntityAdded += (sender, entityId) => OnEntityAdded(entityId);
|
||||
_world.EntityManager.EntityRemoved += (sender, entityId) => OnEntityRemoved(entityId);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnEntityAdded(int entityId) { }
|
||||
protected virtual void OnEntityRemoved(int entityId) { }
|
||||
|
||||
public Bag<int> ActiveEntities => _subscription.ActiveEntities;
|
||||
|
||||
public abstract void Initialize(IComponentMapperService mapperService);
|
||||
|
||||
Reference in New Issue
Block a user