Exemplo n.º 1
0
 public override void Handle(StateContext stateContext)
 {
     if (this._clockHour >= 19)
     {
         Console.WriteLine("Self-owned space!!!");
     }
 }
Exemplo n.º 2
0
 public override void Handle(StateContext stateContext)
 {
     if (this._clockHour >= 14 && this._clockHour < 19)
     {
         Console.WriteLine("Full of energy to work!!!");
     }
     else
     {
         stateContext._state = new NightState(this._clockHour);
         stateContext.Request();
     }
 }
Exemplo n.º 3
0
 public override void Handle(StateContext stateContext)
 {
     if (this._clockHour < 12)
     {
         Console.WriteLine("A lot of meetings to attend!");
     }
     else
     {
         stateContext._state = new NoonState(this._clockHour);
         stateContext.Request();
     }
 }
Exemplo n.º 4
0
 public override void Handle(StateContext stateContext)
 {
     if (this._clockHour >= 12 && this._clockHour < 14)
     {
         Console.WriteLine("It's a really hungry and sleepy time");
     }
     else
     {
         stateContext._state = new AfternoonState(this._clockHour);
         stateContext.Request();
     }
 }
Exemplo n.º 5
0
 public abstract void Handle(StateContext stateContext);