Beispiel #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));
        }
Beispiel #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));
     });
 }
Beispiel #3
0
 public Location(MarsArea marsArea, RoverLocation roverLocation)
 {
     _marsArea      = marsArea;
     _roverLocation = roverLocation;
 }
Beispiel #4
0
 public RoverProcessor(MarsArea marsArea, RoverDiscoveryInformation roverDiscoveryInformation)
 {
     _roverDiscoveryInformation = roverDiscoveryInformation;
     _rover            = GetRover(marsArea, roverDiscoveryInformation.Location);
     _roverCommandList = GetRoverCommandList(roverDiscoveryInformation.Command);
 }