Closed softwareantics closed 11 months ago
This should likely be added to the ECS project.
public interface IStep { void Next(Enum condition); } public interface ISequencer { void AddStep(IStep step); void RemoveStep(IStep step); void Execute(Enum condition); } // Use public class MeshRenderSystem : EntitySystemBase, IStep { protected override void Process([NotNull] IEnumerable<Entity> entities) { foreach (var entity in entities) { renderingEngine.DrawMesh(entity); } } public void Next() { this.Process(); } } public class LightRenderSystem : EntitySystemBase { protected override void Process([NotNull] IEnumerable<Entity> entities) { foreach (var entity in entities) { shaderProgram.Bind(); shaderProgram.SetUniforms(entity.GetComponent<LightComponent>()); // Render all geometry this.sequencer.Next(); } } } var sequencer = new Sequencer() .AddStep(new Step() { new { typeof(LightRenderSystem) }, new { meshRenderSystem } });
This should likely be added to the ECS project.