public LawnMowerMachineEventArgs(Direction Direction, int width, int height, ILocation location, string cmdLog, Boolean running, ILawnMowerMachineCommand cmd, int timeToRun = -1) { MachineDirection = Direction; MachineLocation = location; MachineRunning = running; CurrentCommandTimeExpectedToFinish = timeToRun; CommandLog = cmdLog; LastCommand = cmd; MaxX = width; MaxY = height; }
/// <summary> /// Process Commands /// </summary> private void StartConsuming() { while (true) { try { ILawnMowerMachineCommand currentCommand = null; _commandQueue.TryDequeue(out currentCommand); if (currentCommand != null) { // Execute Command currentCommand.Execute(this); LastCommand = currentCommand; } } catch (Exception exp) { // log string details = exp.ToString(); } } }
public void AddCommandToHistory(ILawnMowerMachineCommand command) { CommandHistory.Add(command); }
public LawnEventArgs(SlmmDto data, ILawnMowerMachineCommand cmd) { lawnData = data; LastCommand = cmd; }
public void AddCommand(ILawnMowerMachineCommand command) { _commandQueue.Enqueue(command); }