Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 public void GoToNextState(StateContext context)
 {
     Console.WriteLine("DONE!");
 }
Exemplo n.º 3
0
 public void GoToNextState(StateContext context)
 {
     context.State = new Stage2State();
     Console.WriteLine("Starting...");
 }
Exemplo n.º 4
0
 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...");
 }