Exemple #1
0
        private Rover GetRover(MarsArea marsArea, string locationText)
        {
            RoverLocation roverLocation = GetRoverLocation(locationText);

            IDirectionState directionState = GetDirectionState(locationText);
            ILocation       location       = new Location(marsArea, roverLocation);

            return(new Rover(directionState, location));
        }
Exemple #2
0
 public MarsDiscover(MarsDiscoveryInformation marsDiscoveryInformation)
 {
     _roverProcessorList = new ConcurrentBag <IRoverProcessor>();
     _marsArea           = GetMarsArea(marsDiscoveryInformation.Area);
     Parallel.ForEach(marsDiscoveryInformation.RoverInformationList, roverInfo =>
     {
         _roverProcessorList.Add(new RoverProcessor(_marsArea, roverInfo));
     });
 }
Exemple #3
0
 public Location(MarsArea marsArea, RoverLocation roverLocation)
 {
     _marsArea      = marsArea;
     _roverLocation = roverLocation;
 }
Exemple #4
0
 public RoverProcessor(MarsArea marsArea, RoverDiscoveryInformation roverDiscoveryInformation)
 {
     _roverDiscoveryInformation = roverDiscoveryInformation;
     _rover            = GetRover(marsArea, roverDiscoveryInformation.Location);
     _roverCommandList = GetRoverCommandList(roverDiscoveryInformation.Command);
 }