Esempio n. 1
0
    private void onStateChange()
    {
        PlayerPiece currentPiece = team.getActivePiece();

        switch (turnState)
        {
        case TurnState.DebutTour:
            team.onPlayerActive(this);
            currentPiece = team.getActivePiece();
            DicesManager.Instance.showDices();
            setTurnState(TurnState.LancementDeReperes);
            break;

        case TurnState.LancementDeReperes:
            launchDiceReperes();
            break;

        case TurnState.LancementDeDistance:
            launchDiceForDistance();
            break;

        case TurnState.LancementDeOrientation:
            launchDiceForOrientation();
            break;

        case TurnState.ChoixChemin:
            if (currentPiece != null)
            {
                currentPiece.moveCells.Clear();
            }
            break;

        case TurnState.Deplacement:
            PlayersManager.Instance.hideButtons();
            if (currentPiece != null)
            {
                currentPiece.moveOnPath(onMovePathDone);
            }
            break;

        case TurnState.FinTour:
            if (currentPiece != null)
            {
                currentPiece.setAsPlaying(false);
            }
            DicesManager.Instance.hideDices();
            break;
        }
    }