Esempio n. 1
0
 public override void WirteProgram(Work w)
 {
     if (w.Hour < 12)
     {
         Console.WriteLine("早上{0}点工作中", w.Hour);
     }
     else
     {
         w.SetState(new NoonState()); w.WriteProgram();
     }
 }
Esempio n. 2
0
 public override void WirteProgram(Work w)
 {
     if (w.Hour < 17)
     {
         Console.WriteLine("中午{0}点工作中", w.Hour);
     }
     else
     {
         w.SetState(new EveningState()); w.WriteProgram();
     }
 }
Esempio n. 3
0
 public override void WirteProgram(Work w)
 {
     if (!w.Finsh)
     {
         Console.WriteLine("晚上{0}点加班中", w.Hour);
     }
     else
     {
         w.SetState(new SleepingState()); w.WriteProgram();
     }
 }