Example #1
0
 /// <summary>
 /// State exit event. Hides view elements.
 /// </summary>
 public override void Exit()
 {
     ui.Hide();
     turn.Exit();
     turn = null;
     HideInGameMenu();
     DetachMapEventHandlers();
     DetachUiEventHandlers();
     base.Exit();
 }
Example #2
0
    public void NextTurn()
    {
        currentTurn.Exit(ruleManager);
        view.ShowCurrentBoard(ruleManager.Board);

        var next = currentTurn;

        currentTurn = nextTurn;
        nextTurn    = next;

        ruleManager.FindSquaresToPut(currentTurn);
        currentTurn.Enter(ruleManager);
        view.ShowInputMessage(currentTurn);
        currentTurn.Execute(ruleManager);
    }
Example #3
0
 private void Enter(TurnState next)
 {
     current.Exit();
     current = next;
     next.Enter();
 }