public Journey[] FindJourneysByFilter(string portFrom, string portTo, JourneyFilter filterType, int value) { var journeys = CreatePossibleJourneysBetweenPorts(portFrom, portTo); switch (filterType) { case JourneyFilter.MinStops: journeys = journeys.Where(j => j.Routes.Count >= value).ToArray(); break; case JourneyFilter.MaxStops: journeys = journeys.Where(j => j.Routes.Count <= value).ToArray(); break; case JourneyFilter.ExactStops: journeys = journeys.Where(j => j.Routes.Count == value).ToArray(); break; case JourneyFilter.MinDuration: journeys = journeys.Where(j => j.Duration >= value).ToArray(); break; case JourneyFilter.MaxDuration: journeys = journeys.Where(j => j.Duration <= value).ToArray(); break; } return journeys; }
public Journey[] FindJourneysByFilter(string portFrom, string portTo, JourneyFilter filterType, int value) { var journeys = CreatePossibleJourneysBetweenPorts(portFrom, portTo); switch (filterType) { case JourneyFilter.MinStops: journeys = journeys.Where(j => j.Routes.Count >= value).ToArray(); break; case JourneyFilter.MaxStops: journeys = journeys.Where(j => j.Routes.Count <= value).ToArray(); break; case JourneyFilter.ExactStops: journeys = journeys.Where(j => j.Routes.Count == value).ToArray(); break; case JourneyFilter.MinDuration: journeys = journeys.Where(j => j.Duration >= value).ToArray(); break; case JourneyFilter.MaxDuration: journeys = journeys.Where(j => j.Duration <= value).ToArray(); break; } return(journeys); }
public SelectionParameters(SelectionSeverity severity, int nRequired = 0, bool getMaxData = false, bool useJourney = true, JourneyFilter journeyFilter = JourneyFilter.CurrentJourney, PackListHistory packListHistory = PackListHistory.NoFilter, List <string> filteringIds = null, bool sortDataByDifficulty = false) { this.nRequired = nRequired; this.getMaxData = getMaxData; this.severity = severity; this.useJourney = useJourney; this.journeyFilter = journeyFilter; this.packListHistory = packListHistory; this.filteringIds = filteringIds; this.sortDataByDifficulty = sortDataByDifficulty; }
public void AssignJourney(bool insideJourney) { journeyFilter = JourneyFilter.CurrentJourney; priorityFilter = insideJourney ? PriorityFilter.CurrentThenPast : PriorityFilter.NoPriority; }