Beispiel #1
0
 public void Notify(WeatherInCity weather)
 {
     foreach (Subscriber subscriber in subscriptions)
     {
         subscriber.Observe(weather);
     }
 }
Beispiel #2
0
 public void Observe(WeatherInCity weather)
 {
     if (this.strategy != null && this.strategy.IsOk(weather.WeatherForecast))
     {
         Console.WriteLine($"{DateTime.Now}: Hey {Login}, the weather in {weather.City} will be good, have fun!");
     }
 }