static void Main(string [] args) { WeatherData.WeatherData wd = new WeatherData.WeatherData(); StatsDisplay statsDisplay = new StatsDisplay(); Display display = new Display(); wd.RegisterObserver(display, 5); wd.RegisterObserver(statsDisplay, 4); wd.SetMeasurements(3, 0.7, 760, 10, 90); wd.SetMeasurements(4, 0.8, 761, 8, 100); }
static void Main(string [] args) { WeatherData.WeatherData weatheDataOut = new WeatherData.WeatherData(Observer.LocationKind.Outside); WeatherData.WeatherData weatheDataIn = new WeatherData.WeatherData(Observer.LocationKind.Inside); Display display = new Display(weatheDataIn, weatheDataOut, 1); StatsDisplay statsDisplay = new StatsDisplay(weatheDataIn, weatheDataOut, 2); weatheDataOut.SetMeasurements(3, 0.7, 760); weatheDataIn.SetMeasurements(10, 0.8, 761); }