Esempio n. 1
0
 public override void WriteProgram(Work w)
 {
     if (w.TaskFinished)
     {
         w.SetState(new RestState());
         w.WriteProgram();
     }
     else
     {
         if (w.Hour < 21)
         {
             Console.WriteLine($"當前時間{w.Hour}點,加班囉,好厭世");
         }
         else
         {
             w.SetState(new SleepingState());
             w.WriteProgram();
         }
     }
 }
Esempio n. 2
0
 public override void WriteProgram(Work w)
 {
     if (w.TaskFinished)
     {
         w.SetState(new ResetState());//如果任务完成,则转入下班状态
         w.WriteProgram();
     }
     else
     {
         if (w.Hour < 21)
         {
             Console.WriteLine("当前时间:{0}点,加班哦,疲累之极.", w.Hour);
         }
         else
         {
             w.SetState(new SleepingState());
             w.WriteProgram();
         }
     }
 }
Esempio n. 3
0
 public override void WriteProgram(Work w)
 {
     if (w.TaskFinished)
     {
         w.SetState(new ResetState());
         w.WriteProgram();
     }
     else
     {
         if (w.Hour < 21)
         {
             Console.WriteLine($"当前时间:{w.Hour}点 加班哦,疲惫至极");
         }
         else
         {
             w.SetState(new SleepingState());
             w.WriteProgram();
         }
     }
 }
 public override void WriteProgram(Work work)
 {
     if (work.TaskFinished)
     {
         work.SetState(new RestState());
         work.WriteProgram();
     }
     else
     {
         if (work.Hour < 21)
         {
             Console.WriteLine($"當前時間: {work.Hour}點 加班喔,疲勞至極");
         }
         else
         {
             work.SetState(new SleepingState());
             work.WriteProgram();
         }
     }
 }
 public override void WriteProgram(Work work)
 {
     if (work.TaskFinished)
     {
         work.SetState(new RestState());
         work.WriteProgram();
     }
     else
     {
         if (work.Hour < 21)
         {
             Console.WriteLine("当前时间:{0}点 加班哦,疲累至极!", work.Hour);
         }
         else
         {
             work.SetState(new SleepingState());
             work.WriteProgram();
         }
     }
 }
Esempio n. 6
0
 public override void WriteProgram(Work work)
 {
     if (work.Finish)
     {
         work.SetState(new RestState());
         work.WriteProgram();
     }
     else
     {
         if (work.Hour < 21)
         {
             System.Console.WriteLine($"当前时间:{work.Hour}点,继续加班");
         }
         else
         {
             work.SetState(new SleepState());
             work.WriteProgram();
         }
     }
 }
Esempio n. 7
0
 public override void WriteProgram(Work w)
 {
     if (w.Finish)
     {
         w.SetState(new RestState());
         w.WriteProgram();
     }
     else
     {
         if (w.Hour < 21)
         {
             Console.WriteLine("当前时间:{0}点 加班哦,疲累之极",w.Hour);
         }
         else
         {
             w.SetState(new SleepingState());
             w.WriteProgram();
         }
     }
 }
Esempio n. 8
0
 public override void WriteProgram(Work w)
 {
     if (w.Finish)
     {
         w.SetState(new RestState());
         w.WriteProgram();
     }
     else
     {
         if (w.Hour < 21)
         {
             Console.WriteLine("当前时间:{0}点 加班哦,疲累之极", w.Hour);
         }
         else
         {
             w.SetState(new SleepingState());
             w.WriteProgram();
         }
     }
 }
Esempio n. 9
0
 public override void WriteProgram(Work w)
 {
     if (w.Hour < 17)
     {
         Console.WriteLine("当前时间:{0}点 下午状态还不错,继续努力",w.Hour);
     }
     else
     {
         w.SetState(new EveningState());
         w.WriteProgram();
     }
 }
Esempio n. 10
0
 public override void WriteProgram(Work w)
 {
     if (w.Hour < 12)
     {
         Console.WriteLine($"當前時間{w.Hour}點,上午工作,精神百倍");
     }
     else
     {
         w.SetState(new NoonState());
         w.WriteProgram();
     }
 }
Esempio n. 11
0
 public override void WriteProgram(Work w)
 {
     if (w.Hour < 13)
     {
         Console.WriteLine($"當前時間{w.Hour}點,餓了,覺得想睡");
     }
     else
     {
         w.SetState(new AfternoonState());
         w.WriteProgram();
     }
 }
 public override void WriteProgram(Work w)
 {
     if (w.Hour < 17)
     {
         Console.WriteLine($"當前時間{w.Hour}點,下午精神不錯,繼續努力");
     }
     else
     {
         w.SetState(new EveningState());
         w.WriteProgram();
     }
 }
 public override void WriteProgram(Work work)
 {
     if (work.Hour < 12)
     {
         Console.WriteLine($"當前時間: {work.Hour}點 上午工作,精神百倍");
     }
     else
     {
         work.SetState(new NoonState());
         work.WriteProgram();
     }
 }
Esempio n. 14
0
 public override void WriteProgram(Work w)
 {
     if (w.Hour < 13)
     {
         Console.WriteLine("当前时间:{0}点 饿了,午饭:犯困,午休。", w.Hour);
     }
     else
     {
         w.SetState(new AfternoonState());
         w.WriteProgram();
     }
 }
Esempio n. 15
0
 public override void WriteProgram(Work w)
 {
     if (w.Hour < 13)
     {
         Console.WriteLine("当前时间:{0}点,饿了,午饭:犯困,午休.", w.Hour);
     }
     else
     {
         w.SetState(new AfternoonState());
         w.WriteProgram();
     }
 }
Esempio n. 16
0
 public override void WriteProgram(Work w)
 {
     if (w.Hour < 17)
     {
         Console.WriteLine("当前时间:{0}点 下午状态还不错,继续努力", w.Hour);
     }
     else
     {
         w.SetState(new EveningState());
         w.WriteProgram();
     }
 }
Esempio n. 17
0
 public override void WriteProgram(Work w)
 {
     if (w.Hour < 13)
     {
         Console.WriteLine($"当前时间:{w.Hour}点 饿了,午饭,犯困,午休");
     }
     else
     {
         w.SetState(new AfternoonState());
         w.WriteProgram();
     }
 }
Esempio n. 18
0
 public override void WriteProgram(Work work)
 {
     if (work.Hour < 13)
     {
         Console.WriteLine("当前时间:{0}点 饿了,午饭:犯困,午休。", work.Hour);
     }
     else
     {
         work.SetState(new AfternoonState());
         work.WriteProgram();
     }
 }
Esempio n. 19
0
 public override void WriteProgram(Work work)
 {
     if (work.Hour < 17)
     {
         System.Console.WriteLine($"当前时间:{work.Hour}点,有点困");
     }
     else
     {
         work.SetState(new EveningState());
         work.WriteProgram();
     }
 }
Esempio n. 20
0
 public override void WriteProgram(Work work)
 {
     if (work.Hour < 13)
     {
         System.Console.WriteLine($"当前时间:{work.Hour}点,午休会");
     }
     else
     {
         work.SetState(new AfternoonState());
         work.WriteProgram();
     }
 }
Esempio n. 21
0
 public override void WriteProgram(Work work)
 {
     if (work.Hour < 12)
     {
         System.Console.WriteLine($"当前时间:{work.Hour}点,开始工作");
     }
     else
     {
         work.SetState(new NonnState());
         work.WriteProgram();
     }
 }
Esempio n. 22
0
 public override void WriteProgram(Work w)
 {
     if (w.Hour < 12)
     {
         Console.WriteLine("当前时间:{0}点 上午工作,精神百倍",w.Hour);
     }
     else
     {
         w.SetState(new NoonState());
         w.WriteProgram();
     }
 }
Esempio n. 23
0
 public override void WriteProgram(Work work)
 {
     if (work.Hour < 17)
     {
         Console.WriteLine($"當前時間: {work.Hour}點 下午狀態還不錯,繼續努力");
     }
     else
     {
         work.SetState(new EveningState());
         work.WriteProgram();
     }
 }
Esempio n. 24
0
 public override void WriteProgram(Work work)
 {
     if (work.Hour < 13)
     {
         Console.WriteLine($"當前時間: {work.Hour}點 餓了午休吃飯睡覺");
     }
     else
     {
         work.SetState(new AfternoonState());
         work.WriteProgram();
     }
 }
Esempio n. 25
0
 public override void WriteProgram(Work w)
 {
     if (w.Hour < 12)
     {
         Console.WriteLine("当前时间:{0}点 上午工作,精神百倍", w.Hour);
     }
     else
     {
         w.SetState(new NoonState());
         w.WriteProgram();
     }
 }