Exemplo n.º 1
0
    // Methods ////////////////////////////////////////////////////////////////////////////////////

    public static WaitingForAction GetInstance()
    {
        if (StateInstance == null)
        {
            StateInstance = new WaitingForAction();
        }
        return(StateInstance);
    }
Exemplo n.º 2
0
    //---------------------------------------------------------------------------------------------

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

        currentPlayer.RemoveCard(cardManager.cardPlayed);
        ShowTurnView(true);
        ShowBoardView(false);
    }
Exemplo n.º 3
0
    //---------------------------------------------------------------------------------------------

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

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

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

        if (show)
        {
            CurrentState = CardViewing.GetInstance();
        }
        else
        {
            CurrentState = WaitingForAction.GetInstance();
        }
    }
Exemplo n.º 5
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);
    }
Exemplo n.º 6
0
    //---------------------------------------------------------------------------------------------

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

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