namespace Lab505.Script.Sim; /// /// Isolated per-user simulation context. /// Each FlowContext built from this context has its own independent robot state. /// public sealed class SimContext { public SimConveyor Conveyor { get; } = new(); public SimImr IMR { get; } = new(); public SimAmr AMR { get; } = new(); public SimAsrs ASRS { get; } = new(); public SimDobot Dobot { get; } = new(); public SimFlow Workflow { get; } /// Fires whenever any simulated robot/device changes state. public event Action? OnChanged; public SimContext() { Workflow = new SimFlow(this); IMR.OnMoved += _ => OnChanged?.Invoke(); AMR.OnMoved += _ => OnChanged?.Invoke(); Conveyor.OnChanged += () => OnChanged?.Invoke(); } }