Ejemplo n.º 1
0
        /// <summary>
        /// Find the station with the shortes waiting list.
        /// </summary>
        /// <param name="nextStations">The collection of which the search is made on.</param>
        /// <returns></returns>
        private StationModel GetBestStation(ICollection <StationModel> nextStations)
        {
            int          min             = int.MaxValue;
            StationModel stationToReturn = null;

            foreach (StationModel station in nextStations)
            {
                if (station.WaitingStationsList.Count < min)
                {
                    stationToReturn = station;
                    min             = station.WaitingStationsList.Count;
                }
            }
            return(stationToReturn);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Adds station to the NextLandingStations list.
 /// </summary>
 /// <param name="station">The station instance being added.</param>
 public void AddLandingStation(StationModel station)
 {
     NextLandingStations.Add(station);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Adds station to the NextDepartureStations list.
 /// </summary>
 /// <param name="station">The station instance being added.</param>
 public void AddDepartureStation(StationModel station)
 {
     NextDepartureStations.Add(station);
 }