Пример #1
0
        public IEnumerable <string> SendCommands([FromBody] Command command)
        {
            try
            {
                var plateau = _parse.ToPlateau(command.Plateau);
                var rovers  = new List <string>();

                foreach (var rover in command.Rovers)
                {
                    var position  = _parse.ToRover(rover.Position);
                    var movements = _parse.ToMovemenent(rover.Movement);
                    var result    = _squad.Deploy(plateau, position, movements);

                    rovers.Add(_parse.ToString(result));
                }

                return(rovers);
            }
            catch (Exception ex)
            {
                _logger.LogError("Failed to deploy rover!", ex);
                return(null);
            }
        }
Пример #2
0
 public void Execute()
 {
     _squad.Deploy(landingPosition, orientation);
 }