public override void Disable() { Console.WriteLine("Начинаем выключаться..."); ShowState(); _nextState = new LoadingState(); Computer.SetState(_nextState); _nextState.Disable(); }
public override void Enable() { Console.WriteLine("Начинаем запуск..."); ShowState(); _nextState = new LoadingState(); Computer.SetState(_nextState); _nextState.Enable(); }
public override void Disable() { Console.WriteLine("Выключаемся..."); ShowState(); Task.Delay(1000).Wait(); _nextState = new StartState(); Computer.SetState(_nextState); _nextState.Disable(); }
public override void Enable() { Console.WriteLine("Загружаемся..."); ShowState(); Task.Delay(2000).Wait(); _nextState = new LoadedState(); Computer.SetState(_nextState); _nextState.Enable(); }
public void SetState(AbstractBootState state) { State = state; State.SetComputer(this); }
public Computer() { State = new StartState(); State.SetComputer(this); }