Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            WeatherData weatherData = new WeatherData();

            DisplayOne display_one = new DisplayOne(weatherData);
            DisplayTwo display_two = new DisplayTwo(weatherData);

            WeatherState weatherState = new WeatherState();

            weatherState.Humidity    = 0.0f;
            weatherState.Temperature = 65.3f;

            weatherData.updateWeatherState(weatherState);
        }
Exemplo n.º 2
0
 public void updateWeatherState(WeatherState weatherState)
 {
     this.WeatherState = weatherState;
     this.notifyObservers();
 }