Exemple #1
0
 private void SwitchTurnState(TurnState turnState)
 {
     if (turnState != turn)
     {
         turn.Exit();
         turn = turnState;
         turn.Enter();
     }
 }
Exemple #2
0
    public void GameStart()
    {
        ruleManager.Init();
        ruleManager.FindSquaresToPut(currentTurn);

        currentTurn.Enter(ruleManager);
        view.ShowCurrentBoard(ruleManager.Board);
        view.ShowInputMessage(currentTurn);
        currentTurn.Execute(ruleManager);
    }
Exemple #3
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);
    }
Exemple #4
0
    private void BeginTurn()
    {
        PlayerInfo player = mapManager.Players[currentPlayer];

        foreach (Unit unit in player.Units)
        {
            if (unit != null)
            {
                unit.BeginTurn();
            }
        }

        turn = new ReadyState(ui, player);
        turn.Enter();
        player.MainCamera.gameObject.SetActive(true);
        player.MinimapCamera.gameObject.SetActive(true);
    }
Exemple #5
0
 private void Enter(TurnState next)
 {
     current.Exit();
     current = next;
     next.Enter();
 }