implemented aspect filtering builder

This commit is contained in:
Dylan Wilson
2018-06-10 23:49:35 +10:00
parent 30f852253f
commit a9ec00a21f
16 changed files with 397 additions and 30 deletions
@@ -1,8 +1,26 @@
namespace MonoGame.Extended.Entities.Systems
using MonoGame.Extended.Collections;
namespace MonoGame.Extended.Entities.Systems
{
public abstract class BaseSystem
{
private readonly Aspect.Builder _aspectBuilder;
protected BaseSystem(Aspect.Builder aspect)
{
_aspectBuilder = aspect;
}
protected Aspect Aspect { get; private set; }
public EntityWorld World { get; internal set; }
public abstract void Initialize(ComponentManager componentManager);
protected Bag<Entity> GetEntities()
{
var aspect = _aspectBuilder.Build(World.ComponentManager);
return World.EntityManager.Entities;
}
}
}
@@ -4,7 +4,8 @@ namespace MonoGame.Extended.Entities.Systems
{
public abstract class DrawSystem : BaseSystem
{
protected DrawSystem()
protected DrawSystem(Aspect.Builder aspect)
: base(aspect)
{
}
@@ -4,7 +4,8 @@ namespace MonoGame.Extended.Entities.Systems
{
public abstract class UpdateSystem : BaseSystem
{
protected UpdateSystem()
protected UpdateSystem(Aspect.Builder aspect)
: base(aspect)
{
}