mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-24 20:12:23 +00:00
almost finished this beast
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using MonoGame.Extended.Collections;
|
||||
|
||||
namespace MonoGame.Extended.Entities.Systems
|
||||
{
|
||||
public abstract class EntityUpdateSystem : UpdateSystem
|
||||
{
|
||||
protected EntityUpdateSystem(Aspect.Builder aspectBuilder)
|
||||
{
|
||||
_aspectBuilder = aspectBuilder;
|
||||
}
|
||||
|
||||
private readonly Aspect.Builder _aspectBuilder;
|
||||
private EntitySubscription _subscription;
|
||||
|
||||
private EntityWorld _world;
|
||||
public EntityWorld World
|
||||
{
|
||||
get => _world;
|
||||
internal set
|
||||
{
|
||||
_world = value;
|
||||
_subscription = new EntitySubscription(_world.EntityManager, _aspectBuilder.Build(_world.ComponentManager));
|
||||
}
|
||||
}
|
||||
|
||||
public Bag<int> ActiveEntities => _subscription.ActiveEntities;
|
||||
|
||||
public abstract void Initialize(IComponentMapperService mapperService);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user