public RepairDroid(IntCodeStateMachine cpu, ICommandInput commandInput) { _cpu = cpu; _commandInput = commandInput; _commandInput.InputReceived += (_, v) => { var cmd = (MovementCommand)v; if (v < 1 || v > 4) { throw new Exception("Wrong input value"); } _cpu.SetInput((int)cmd); }; _cpu.OnOutput += (_, o) => { _lastOutput = (RepairDroidStatusCode)o; OnReply?.Invoke(this, _lastOutput); commandInput.AwaitInput(); }; }
public ReportStatusEventArgs(RepairDroidStatusCode statusCode) : base() { StatusCode = statusCode; }