示例#1
0
        private void NotifyStationsObserver(IStationsDisplay observer)
        {
            List <TrainStation> remainingStations = new List <TrainStation>();

            for (int i = currentStation + 1; i < stations.Count; i++)
            {
                remainingStations.Add(stations[i]);
            }
            observer.Update(remainingStations);
        }
示例#2
0
 public void RemoveStationsObserver(IStationsDisplay observer)
 {
     stationsObservers.Remove(observer);
 }
示例#3
0
 public void AddStationsObserver(IStationsDisplay observer)
 {
     stationsObservers.Add(observer);
     NotifyStationsObserver(observer);
     NrOfStationsObservers++;
 }