Example #1
0
 public void Move(IEnumerable <Movement> movements, IMars _mars)
 {
     foreach (var movement in movements)
     {
         movementMethodDictionary[movement].Invoke(_mars);
     }
 }
Example #2
0
 public void SetInMars(IMars _mars, Position _position, CardinalDirection _orientation)
 {
     if (_mars.IsValid(_position))
     {
         Position          = _position;
         CardinalDirection = _orientation;
         return;
     }
 }
Example #3
0
        public CommandCenter(ICommandParser _commandParser, ICommandInvoker _commandInvoker)
        {
            robots         = new List <IRobot>();
            Mars           = new Mars();
            reportComposer = new OutputParser();


            commandParser  = _commandParser;
            commandInvoker = _commandInvoker;
            commandInvoker.SetDimensionMars(Mars);
            commandInvoker.SetRobots(robots);
        }
Example #4
0
 public MarsRoverApp(
     IConfiguration config,
     IInstructionInputParser instructionInputParser,
     IRoverGrid roverGrid,
     IMars marse
     )
 {
     _config = config;
     _instructionInputParser = instructionInputParser;
     _roverGrid = roverGrid;
     _marse     = marse;
 }
Example #5
0
 private void MovePosition(Position _position, IMars mars)
 {
     if (!IsLost)
     {
         if (mars.IsValid(_position))
         {
             Position = _position;
         }
         else
         {
             IsLost = true;
         }
     }
 }
Example #6
0
 public void SetReceiver(IRobot _robot, IMars _mars)
 {
     Robot = _robot;
     Mars  = _mars;
 }
Example #7
0
 public void SetReceiver(IMars _mars)
 {
     Mars = _mars;
 }
Example #8
0
 public MarsDimensionCommand(Dimension _dimension, IMars _mars)
 {
     Mars      = _mars;
     Dimension = _dimension;
 }
Example #9
0
 public void SetDimensionMars(IMars _mars)
 {
     Mars = _mars;
 }
Example #10
0
 public Operation(IMars marseRover, IRoverGrid grid, IInstructionInputParser inputParser)
 {
     Marse  = marseRover;
     Board  = grid;
     Parser = inputParser;
 }