Exemplo n.º 1
0
        private List <Tuple <AnyPlace, AnyPlace> > GetAnyPlaces(int numberOfPlaces, AnywherePlace query)
        {
            List <Tuple <AnyPlace, AnyPlace> > res = new List <Tuple <AnyPlace, AnyPlace> >();

            foreach (var qq in query.Quotes)
            {
                int      originId      = qq.OutboundLeg.OriginId;
                int      destinationId = qq.OutboundLeg.DestinationId;
                AnyPlace Origin        = null;
                AnyPlace Destination   = null;
                foreach (AnyPlace place in query.Places)
                {
                    if (place.PlaceId == originId)
                    {
                        Origin = place;
                    }
                    if (place.PlaceId == destinationId)
                    {
                        Destination = place;
                    }

                    if (Origin != null && Destination != null)
                    {
                        break;
                    }
                }

                res.Add(new Tuple <AnyPlace, AnyPlace>(Origin, Destination));
            }
            return(res.Take(numberOfPlaces).ToList());
        }
Exemplo n.º 2
0
 private Tuple <AnyPlace, AnyPlace> GetFirstPlaceFromAnywhere(AnywherePlace firstPlace)
 {
     return(firstPlace.GetLocation());
 }