コード例 #1
0
 public void Notify(ICarObserverManager carObserverManager)
 {
     if ((carObserverManager as SomeCar).EngineState < 20)
     {
         Console.WriteLine($"BrokenEngineObserver: Engine is in bad state. It is unusable and needs fixing. Engine state: {(carObserverManager as SomeCar).EngineState}.");
     }
 }
コード例 #2
0
ファイル: EngineStateObserver.cs プロジェクト: viesl/Training
 public void Notify(ICarObserverManager carObserverManager)
 {
     if ((carObserverManager as SomeCar).EngineState < 50)
     {
         Console.WriteLine($"EngineStateObserver: Engine state has decreased. Engine state: {(carObserverManager as SomeCar).EngineState}.");
     }
 }