public static void InitializeConditions() { MarsGrid = null; RobotId = 0; PositionInput = null; InputRobots.Clear(); }
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(); } }
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(); }
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)); } }
private bool ProcessOutputCanExecuteCommand() { return(InputRobots != null && InputRobots.Any() && RobotPositionInputEnabled && !RobotsProcessedOutputs.Any()); }