private static IList <StationLocation> BluewardPath(StationLocation fromLocation, StationLocation toLocation) { var bluewardLocation = fromLocation.BluewardStationLocation(); if (bluewardLocation == null) { return(null); } if (bluewardLocation == toLocation) { return new List <StationLocation> { toLocation } } ; var oppositeDeckPath = OppositeDeckPath(bluewardLocation.Value, toLocation); if (oppositeDeckPath != null) { return new List <StationLocation> { bluewardLocation.Value, oppositeDeckPath.Single() } } ; var bluewardPath = BluewardPath(bluewardLocation.Value, toLocation); return(bluewardPath == null ? null : new [] { bluewardLocation.Value }.Concat(BluewardPath(bluewardLocation.Value, toLocation)).ToList()); }
protected override StationLocation?GetStationToSpreadTo(StationLocation stationLocation) { return(stationLocation.BluewardStationLocation()); }