Beispiel #1
0
    public void manageWACardPotAmt(string winnerName, int totalBalance, int winningAmt)
    {
        PlayerBean winnerPlayer = playersManager.findWinnerPlayerFromName(winnerName);

        StartCoroutine(manageWinnerPlayers(winnerPlayer));
        winnerPlayer.setPlayerBalance(totalBalance);
        txtLog.text = txtLog.text.ToString() + "\n\nWA pot winner is " + winnerName + "\nWinning Amount : " + winningAmt + "\n";
    }
    public void manageGameFinishAction(string winnerPlayerName, int rank, int winnerPlayerWinningAmount, int winnerPlayerTotalBalance, List <string> listBestCard)
    {
        if (GAME_STATUS == GameConstant.FINISHED)
        {
            iTween.Stab(gameObject, iTween.Hash("audioclip", winnerAudio, "pitch", 1));
            bool isAllAreFolded = playersManager.isAllPlayersAreFolded();
            defaultCardsManager.openFlopCards();
            defaultCardsManager.openTurnCards();
            defaultCardsManager.openRiverCards();

            resetDefaultCards(false);
            resetWinningPlayers(false);

            isRunningGame = false;
            setEnableDisableOptions(false);

            txtLog.text = txtLog.text.ToString() + "\nWinner is " + winnerPlayerName + "\nRank : " + getRankName((HAND_RANK)rank) + "\nWinning Amount : " + winnerPlayerWinningAmount + "\n";

            PlayerBean winnerPlayer = playersManager.findWinnerPlayerFromName(winnerPlayerName);
            StartCoroutine(manageWinnerPlayers(winnerPlayer));
            winnerPlayer.setPlayerBalance(winnerPlayerTotalBalance);

            //DEBUG.Log ("Game Finish : Winner is " + winnerPlayerName + " >> Rank : " + (HAND_RANK)rank);

            if (!isAllAreFolded)
            {
                winnerPlayer.getRankPannel().SetActive(true);
                winnerPlayer.getRankText().text  = getRankName((HAND_RANK)rank) + " (" + Utility.GetCurrencyPrefix() + "" + winnerPlayerWinningAmount + ")";
                winnerPlayer.getRankText().color = Color.white;
                playersManager.openAllPlayerCards();
                //reset cards
                foreach (string cardName in listBestCard)
                {
                    GameObject cardGameObject = winnerPlayer.getCardObjectFromCardName(cardName);
                    if (cardGameObject != null)
                    {
                        animationManager.WinningCardAnimation(cardGameObject);
                    }
                    else
                    {
                        cardGameObject = defaultCardsManager.getCardObjectFromCardName(cardName);
                        if (cardGameObject != null)
                        {
                            animationManager.WinningCardAnimation(cardGameObject);
                        }
                    }
                }
            }
            //			StartCoroutine(hideWinnerRankPannel(winnerPlayer));
            Invoke("scrollDown", 1f);
        }
    }
Beispiel #3
0
    public void managePlayerMoveAction(string name, int betamount, int totalTableAmount, int totalPlayerBalance, int action)
    {
        PlayerBean   playerBean         = playersManager.getPlayerFromName(name);
        RoundManager currentRoundManger = getCurrentRoundInfo();

        if (currentRound == GameConstant.WA_ROUND_START && playerBean.isBigBlindPlayer())
        {
            totalBBPlayersTurn++;
        }

        if (currentRoundManger.getRound() == GameConstant.WA_ROUND_WHOOPASS)
        {
            StartCoroutine(managePlayerWACardAction(action, playerBean));
        }
        txtLog.text = txtLog.text.ToString() + "\n" + playerBean.getPlayerName() + " >> Action >> " + getActionName(action) + " >> " + betamount;
        Invoke("scrollDown", 1f);
        if (betamount > 0)
        {
            animationManager.MoveChipsObject(playerBean.getChipObject(), gameObjectManager.getTableChipSetObject());
//			yield return new WaitForSeconds (GameConstant.ANIM_WAITING_TIME);
            playerBean.getChipObject().transform.position = playerBean.getChipPositionObject().transform.position;
        }
        TurnManager turnManager = new TurnManager(playerBean, action, betamount);

        currentRoundManger.addTurnRecord(turnManager);
        int totalBetAmtInRound = currentRoundManger.getTotalPlayerBetAmount(playerBean);

        playerBean.setBetAmount(betamount, totalBetAmtInRound);
        playersManager.setLastPlayerAction(name, action, betamount, totalBetAmtInRound, totalPlayerBalance);
        if (playerBean.getBalance() <= 0 && !playerBean.isAllInPlayer())
        {
            playerBean.setPlayerBalance(0);              // if player balance is not enough
            playerBean.setAllInStatus(true);
        }
        setTotalBetTableAmount(totalTableAmount);
    }
 public void setPlayerBetAmount(PlayerBean player, int betamount, int totalBetAmountInRound, int totalPlayerBalance)
 {
     player.setBetAmount(betamount, totalBetAmountInRound);
     player.setPlayerBalance(totalPlayerBalance);
 }