namespace MoonTools.ECS; public abstract class System : EntityComponentReader { public abstract void Update(TimeSpan delta); public FilterBuilder FilterBuilder => new FilterBuilder(ComponentDepot); public System(World world) { world.AddSystem(this); } protected Entity CreateEntity() { return EntityStorage.Create(); } protected void Set(in Entity entity, in TComponent component) where TComponent : struct { ComponentDepot.Set(entity.ID, component); } protected void Remove(in Entity entity) where TComponent : struct { ComponentDepot.Remove(entity.ID); } protected void Destroy(in Entity entity) { ComponentDepot.OnEntityDestroy(entity.ID); EntityStorage.Destroy(entity); } }