mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-24 03:56:31 +00:00
implemented aspect filtering builder
This commit is contained in:
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user