using System; using Steps = System.Collections.Generic.Dictionary>; namespace Svelto.ECS { public interface IStep { } public interface IStep:IStep { void Step(ref T token, Enum condition); } public class Sequencer { public Sequencer() {} public void SetSequence(Steps steps) { _steps = steps; } public void Next(IEngine engine, ref T param) { Next(engine, ref param, Condition.always); } public void Next(IEngine engine, ref T param, Enum condition) { var tos = _steps[engine]; var steps = tos[condition]; if (steps != null) for (int i = 0; i < steps.Length; i++) ((IStep)steps[i]).Step(ref param, condition); } Steps _steps; } public enum Condition { always } }