public override void WriteProgram(Work w) { if (w.TaskFinished) { w.SetState(new RestState()); w.WriteProgram(); } else { if (w.Hour < 21) { Console.WriteLine("當前時間:{0}點 加班哦,疲累之極", w.Hour); } else { w.SetState(new SleepingState()); w.WriteProgram(); } } }
public override void WriteProgram(Work w) { if (w.TaskFinished) { w.SetState(new RestState()); w.WriteProgram(); } else { if (w.Hour < 21) { Console.WriteLine("當前時間:{0}點 加班哦,疲累之極", w.Hour); } else { w.SetState(new SleepingState()); w.WriteProgram(); } } }
public override void WriteProgram(Work w) { if (w.Hour < 12) { Console.WriteLine("當前時間:{0}點 上午工作,精神百倍", w.Hour); } else { w.SetState(new NoonState()); w.WriteProgram(); } }
public override void WriteProgram(Work w) { if (w.Hour < 17) { Console.WriteLine("當前時間:{0}點 下午狀態還不錯,繼續努力", w.Hour); } else { w.SetState(new EveningState()); w.WriteProgram(); } }
public override void WriteProgram(Work w) { if (w.Hour < 17) { Console.WriteLine("當前時間:{0}點 下午狀態還不錯,繼續努力", w.Hour); } else { w.SetState(new EveningState()); w.WriteProgram(); } }
public override void WriteProgram(Work w) { if (w.Hour < 13) { Console.WriteLine("當前時間:{0}點 餓了,午飯;犯困,午休。", w.Hour); } else { w.SetState(new AfternoonState()); w.WriteProgram(); } }
public override void WriteProgram(Work w) { if (w.Hour < 12) { Console.WriteLine("當前時間:{0}點 上午工作,精神百倍", w.Hour); } else { w.SetState(new NoonState()); w.WriteProgram(); } }
public override void WriteProgram(Work w) { if (w.Hour < 13) { Console.WriteLine("當前時間:{0}點 餓了,午飯;犯困,午休。", w.Hour); } else { w.SetState(new AfternoonState()); w.WriteProgram(); } }