//--------------------------------------------------------------------------------------------- public void DonePlayingCard() { CurrentState = WaitingForAction.GetInstance(); Player currentPlayer = CurrentPlayer(); currentPlayer.RemoveCard(cardManager.cardPlayed); ShowTurnView(true); ShowBoardView(false); }
//--------------------------------------------------------------------------------------------- public void Roll() { if (stateManager.CurrentState != WaitingForAction.GetInstance()) { return; } stateManager.CurrentState = WaitingForRoll.GetInstance(); stateManager.ShowBoardView(true, false); stateManager.turnView.SetActive(false); StartCoroutine(DiceCoroutine()); }
//--------------------------------------------------------------------------------------------- public void OpenCardsMenu(bool show) { cardsView.GetComponent <CardMenu>().ShowCardsView(show); ShowTurnView(!show); if (show) { CurrentState = CardViewing.GetInstance(); } else { CurrentState = WaitingForAction.GetInstance(); } }
//--------------------------------------------------------------------------------------------- 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); }
//--------------------------------------------------------------------------------------------- public void ViewBoard(bool show) { ShowBoardView(show); ShowTurnView(!show); if (show) { CurrentState = BoardViewing.GetInstance(); } else { CurrentState = WaitingForAction.GetInstance(); } }