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); }
public void RemoveStationsObserver(IStationsDisplay observer) { stationsObservers.Remove(observer); }
public void AddStationsObserver(IStationsDisplay observer) { stationsObservers.Add(observer); NotifyStationsObserver(observer); NrOfStationsObservers++; }