Exemplo n.º 1
0
 private void Configure(RobotInput input)
 {
     _robotPositioningContext.AddPosition(input.InitialPosition);
     foreach (var command in input.Commands)
     {
         AddCommand(RobotCommandProvider.GetCommand(command, _robotPositioningContext));
     }
 }
Exemplo n.º 2
0
 public RobotInputProcessor()
 {
     _robotInput = new RobotInput();
     _commandCountInputHandler    = new CommandCountInputHandler(_robotInput);
     _initialPositionInputHandler = new InitialPositionInputHandler(_robotInput);
     _commandInputHandler         = new CommandInputHandler(_robotInput);
     _commandCountInputHandler.SetNextInputHandler(_initialPositionInputHandler);
     _initialPositionInputHandler.SetNextInputHandler(_commandInputHandler);
 }
Exemplo n.º 3
0
 public Robot(RobotInput input, IRobotPositioningContext positioningContext)
 {
     _robotPositioningContext = positioningContext;
     Configure(input);
 }
Exemplo n.º 4
0
 public InitialPositionInputHandler(RobotInput input) : base(input)
 {
 }