public void Setup() { _inputValidator = new InputValidator(new InputConfiguration()); _roverFactory = new RoverFactory(); _plateauFactory = new PlateauFactory(); _movingService = new NavigationService(_inputValidator, _roverFactory, _plateauFactory); }
public CommandInvoker(IRoverFactory roverFactory) { this.roverFactory = roverFactory; recieverMethodDictionary = new Dictionary <CommandType, Action <ICommand> > { { CommandType.SetPlateauSize, SetReceiversOnSetPletauSizeCommand }, { CommandType.Land, SetReceiversOnLandingCommand }, { CommandType.Move, SetReceiversOnMovementCommand } }; }
/** * Assume input is of odd Length, where first element is size of grid. */ public RoverCommand(string[] input, IRoverFactory roverFactory) { MatchCollection mc = Regex.Matches(input[0], @"([0-9]+)"); int gridXMax = Convert.ToInt32(mc[0].Value); int gridYMax = Convert.ToInt32(mc[1].Value); rovers = new List<IRover>(); for(int i = 1; i < input.Length; i+=2) { rovers.Add(roverFactory.GetRover(input[i], input[i + 1], gridXMax, gridYMax)); } }
public RoverOrchestrator(IRoverFactory roverFactory, IRoverCommander roverCommander, IRoverFormatter formatter) { _roverFactory = roverFactory; _roverCommander = roverCommander; _formatter = formatter; }
public void SetUp() { _roverFactory = new RoverFactory(); _roverManager = new RoverManager(_roverFactory); _roverManager.CreateRover(0, 0, 'N'); }
public RoverManager(IRoverFactory iRoverFactory) { _roverFactory = iRoverFactory; RoverList = new List <IRover>(); }
public RoverOrchestrator(IRoverFactory roverFactory, IRoverCommander roverCommander, IRoverFormatter formatter) { _roverFactory = roverFactory; _roverCommander = roverCommander; _formatter = formatter; }
public Satellite(IInstructionParser instructionParser, IRoverFactory roverFactory) { this.instructionParser = instructionParser; this.roverFactory = roverFactory; }
public RoverService(IRoverFactory roverFactory, IInstructionParser parser) { _roverFactory = roverFactory; _parser = parser; }
public Simulator(ILevelGeneratorFactory levelGeneratorFactory, IRoverFactory roverFactory, IAiFactory aiFactory) { LevelGeneratorFactory = levelGeneratorFactory ?? throw new ArgumentNullException(nameof(levelGeneratorFactory)); RoverFactory = roverFactory ?? throw new ArgumentNullException(nameof(roverFactory)); AiFactory = aiFactory ?? throw new ArgumentNullException(nameof(aiFactory)); }
public void SetUp() { _iRoverFactory = new RoverFactory(); }
public static void CreateRoverCommandFrom(string[] input, IRoverFactory roverFactory) { roverCommand = new RoverCommand(input, roverFactory); }
public NavigationService(IInputValidator inputValidator, IRoverFactory roverFactory, IPlateauFactory plateauFactory) { _inputValidator = inputValidator; _roverFactory = roverFactory; _plateauFactory = plateauFactory; }