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)); }
public MarsDiscover(MarsDiscoveryInformation marsDiscoveryInformation) { _roverProcessorList = new ConcurrentBag <IRoverProcessor>(); _marsArea = GetMarsArea(marsDiscoveryInformation.Area); Parallel.ForEach(marsDiscoveryInformation.RoverInformationList, roverInfo => { _roverProcessorList.Add(new RoverProcessor(_marsArea, roverInfo)); }); }
public Location(MarsArea marsArea, RoverLocation roverLocation) { _marsArea = marsArea; _roverLocation = roverLocation; }
public RoverProcessor(MarsArea marsArea, RoverDiscoveryInformation roverDiscoveryInformation) { _roverDiscoveryInformation = roverDiscoveryInformation; _rover = GetRover(marsArea, roverDiscoveryInformation.Location); _roverCommandList = GetRoverCommandList(roverDiscoveryInformation.Command); }