static void Main(string[] args) { var context = new StateContext(new StartState()); Console.WriteLine("##########################"); Console.WriteLine(); context.RequestStateChange(); context.RequestStateChange(); context.RequestStateChange(); context.RequestStateChange(); Console.WriteLine(); Console.WriteLine("##########################"); Console.ReadKey(); }
public void GoToNextState(StateContext context) { Console.WriteLine("DONE!"); }
public void GoToNextState(StateContext context) { context.State = new Stage2State(); Console.WriteLine("Starting..."); }
public void GoToNextState(StateContext context) { context.State = new EndStage(); Console.WriteLine("You're almost there: Stage 3!"); }
public void GoToNextState(StateContext context) { context.State = new Stage3State(); Console.WriteLine("You're on the second stage..."); }