Esempio n. 1
0
    //---------------------------------------------------------------------------------------------

    public void DonePlayingCard()
    {
        CurrentState = WaitingForAction.GetInstance();
        Player currentPlayer = CurrentPlayer();

        currentPlayer.RemoveCard(cardManager.cardPlayed);
        ShowTurnView(true);
        ShowBoardView(false);
    }
Esempio n. 2
0
    //---------------------------------------------------------------------------------------------

    public void Roll()
    {
        if (stateManager.CurrentState != WaitingForAction.GetInstance())
        {
            return;
        }

        stateManager.CurrentState = WaitingForRoll.GetInstance();
        stateManager.ShowBoardView(true, false);
        stateManager.turnView.SetActive(false);
        StartCoroutine(DiceCoroutine());
    }
Esempio n. 3
0
    //---------------------------------------------------------------------------------------------

    public void OpenCardsMenu(bool show)
    {
        cardsView.GetComponent <CardMenu>().ShowCardsView(show);
        ShowTurnView(!show);

        if (show)
        {
            CurrentState = CardViewing.GetInstance();
        }
        else
        {
            CurrentState = WaitingForAction.GetInstance();
        }
    }
Esempio n. 4
0
    //---------------------------------------------------------------------------------------------

    public void NewTurn()
    {
        CurrentState    = WaitingForAction.GetInstance();
        CurrentPlayerId = CurrentPlayerId < NumberOfPlayers - 1 ? CurrentPlayerId + 1 : 0;

        if (CurrentPlayer().LostTurn)
        {
            CurrentPlayer().LostTurn = false;
            NewTurn();
        }

        turnView.SetActive(true);
        boardView.SetActive(false);
    }
Esempio n. 5
0
    //---------------------------------------------------------------------------------------------

    public void ViewBoard(bool show)
    {
        ShowBoardView(show);
        ShowTurnView(!show);

        if (show)
        {
            CurrentState = BoardViewing.GetInstance();
        }
        else
        {
            CurrentState = WaitingForAction.GetInstance();
        }
    }