Ejemplo n.º 1
0
 public override void Run()
 {
     Console.WriteLine("Main menu, 1=NewGame, 2=ContinueGame, 3=Help");
     var ceva = Console.ReadLine();
     switch (ceva)
     {
         case "1":
             {
                 nextState = new NewGameState();
                 //game.Do();
                 break;
             }
         case "2":
             {
                 nextState = new ContinueGameState();
                 //game.Do();
                 break;
             }
         case "3":
             {
                 nextState = new HelpGameState();
                 //game.Do();
                 break;
             }
         default:
             {
                 Run();
                 break;
             }
     }
     if (StateFinishedEventHandler != null)
     {
         StateFinishedEventHandler.Invoke(this, new StateEventArgs() { NextState = nextState });
     }
 }
Ejemplo n.º 2
0
 public void ChangeState(AbstractState nextState)
 {
 }
Ejemplo n.º 3
0
 public Game(AbstractState state)
 {
     CurrentState = state;
     CurrentState.StateFinishedEventHandler += CurentState_StateFinishedEventHandler;
     //_state.Run();
 }