Esempio n. 1
0
 public static void InitializeConditions()
 {
     MarsGrid      = null;
     RobotId       = 0;
     PositionInput = null;
     InputRobots.Clear();
 }
Esempio n. 2
0
        private void ProcessOutput()
        {
            if (InputRobots != null && InputRobots.Any())
            {
                foreach (Robot inputRobot in InputRobots)
                {
                    _processRobotMovement.MoveRobot(MarsGrid, inputRobot);
                    RobotsProcessedOutputs.Add(new RobotOutput(inputRobot));
                }

                OnPropertyChanged(nameof(RobotGeneralInputEnabled));
                ((DelegateCommand)ProcessOutputCommand).RaiseCanExecuteChanged();
            }
        }
Esempio n. 3
0
        private void InitializeConditions()
        {
            MarsGrid = null;
            PlainInput.Grid_XCoordinate = string.Empty;
            PlainInput.Grid_YCoordinate = string.Empty;

            PlainInput.RobotInstructionList      = string.Empty;
            PlainInput.RobotPosition_Orientation = string.Empty;
            PlainInput.RobotPosition_XCoordinate = string.Empty;
            PlainInput.RobotPosition_YCoordinate = string.Empty;

            RobotId = 0;

            PositionInput = null;
            InputRobots.Clear();
            RobotsProcessedOutputs.Clear();
            LogMessages.Clear();
        }
Esempio n. 4
0
        private void GenerateRobotInput()
        {
            List <IInstruction> robotInstructionsList = _parseInputsService.ParseInstructionSet(PlainInput.RobotInstructionList);

            if (robotInstructionsList != null && robotInstructionsList.Any())
            {
                InputRobots.Add(new Robot()
                {
                    Id = RobotId, LastValidPosition = PositionInput, InstructionsSet = robotInstructionsList
                });
                ((DelegateCommand)ProcessOutputCommand).RaiseCanExecuteChanged();
                RobotId++;
                PlainInput.RobotInstructionList      = string.Empty;
                PlainInput.RobotPosition_Orientation = string.Empty;
                PlainInput.RobotPosition_XCoordinate = string.Empty;
                PlainInput.RobotPosition_YCoordinate = string.Empty;
                PositionInput = null;
            }

            else
            {
                OnPropertyChanged(nameof(LogMessagesVisibility));
            }
        }
Esempio n. 5
0
 private bool ProcessOutputCanExecuteCommand()
 {
     return(InputRobots != null && InputRobots.Any() && RobotPositionInputEnabled && !RobotsProcessedOutputs.Any());
 }