Пример #1
0
 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;
 }
Пример #2
0
        /// <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();
                }
            }
        }
Пример #3
0
 public void AddCommandToHistory(ILawnMowerMachineCommand command)
 {
     CommandHistory.Add(command);
 }
Пример #4
0
 public LawnEventArgs(SlmmDto data, ILawnMowerMachineCommand cmd)
 {
     lawnData    = data;
     LastCommand = cmd;
 }
Пример #5
0
 public void AddCommand(ILawnMowerMachineCommand command)
 {
     _commandQueue.Enqueue(command);
 }