Пример #1
0
    IEnumerator CollectAllBetCoinsTOCenterOfTable()
    {
        GameObject src  = null;
        GameObject dest = null;

        int i = 0;

        while (i < playersManager.getAllPlayers().Count)
        {
            PlayerBean player = playersManager.getAllPlayers() [i];
            if (!player.isFoldedPlayer())
            {
                src  = player.getBetChipsObject().gameObject;
                dest = gameManagerGameObject.transform.Find("TableChips/ChipsSet1").gameObject;
                movingCoinObject.GetComponent <Image> ().sprite           = src.GetComponent <Image> ().sprite;
                movingCoinObject.GetComponent <RectTransform> ().position = src.GetComponent <RectTransform> ().position;
                animationManager.MoveObject(movingCoinObject, dest);
                src.SetActive(false);
                yield return(new WaitForSeconds(1f));
            }
            yield return(new WaitForSeconds(0.0f));

            i++;
        }
    }
Пример #2
0
    public void highLightTurnPlayer(string player)
    {
        if (isRunningGame)
        {
            PlayerBean currentPlayer = playersManager.setCurrentTurnPlayer(player);

            if (appwarp.username.Equals(player))
            {
                playerBalance = currentPlayer.getBalance();
                RoundManager currentRoundManager = getCurrentRoundInfo();
                if (currentPlayer.isWaitingForGame())
                {
                    sendPlayerActionToServer(0, GameConstant.ACTION_WAITING_FOR_GAME);
                }
                else if (currentRound != GameConstant.TEXASS_ROUND_PREFLOP &&
                         currentRoundManager.getAllTurnRecords().Count == 0 &&
                         !currentPlayer.getPlayerName().Equals(playersManager.getSmallBlindPlayer().getPlayerName()))
                {
                    sendPlayerActionToServer(0, GameConstant.ACTION_NO_TURN);
                }
                else if (currentPlayer.isFoldedPlayer())
                {
                    sendPlayerActionToServer(0, GameConstant.ACTION_FOLDED);
                }
                else if (currentPlayer.isAllInPlayer())
                {
                    sendPlayerActionToServer(0, GameConstant.ACTION_ALL_IN);
                }
                else
                {
                    setEnableDisableOptions(true);
                }
            }
            else
            {
                playerBalance = 0;
                setEnableDisableOptions(false);
                //gameManagerGameObject.transform.Find(GameConstant.UI_PATH_BUTTONS).gameObject.SetActive(false);
            }
        }
        //raiseValue = 0;
        //gameManagerGameObject.transform.Find (GameConstant.UI_PATH_BET_CHIP_DETAILS).GetComponent<Text> ().text = GameConstant.CURRENCY + raiseValue;
    }
Пример #3
0
 public void highLightTurnPlayer(string player)
 {
     if (isRunningGame)
     {
         PlayerBean currentPlayer = playersManager.setCurrentTurnPlayer(player);
         if (appwarp.username.Equals(player))
         {
             playerBalance = currentPlayer.getBalance();
             RoundManager currentRoundManager = getCurrentRoundInfo();
             if (currentPlayer.isWaitingForGame())
             {
                 sendPlayerActionToServer(0, GameConstant.ACTION_WAITING_FOR_GAME);
             }
             else if (currentRound != GameConstant.WA_ROUND_START &&
                      currentRoundManager.getAllTurnRecords().Count == 0 &&
                      !currentPlayer.getPlayerName().Equals(playersManager.getSmallBlindPlayer().getPlayerName()))
             {
                 sendPlayerActionToServer(0, GameConstant.ACTION_NO_TURN);
             }
             else if (currentRound == GameConstant.WA_ROUND_WHOOPASS)
             {
                 if (currentPlayer.isFoldedPlayer())
                 {
                     sendPlayerActionToServer(0, GameConstant.ACTION_WA_NO);
                     waPurchaseOption.SetActive(false);
                 }
                 else
                 {
                     // Check second flop round bet amount
                     waCardAmt = secondFlopRound.getWACardAmount();
                     // Check first flop round bet amount if WA amount 0
                     waCardAmt = waCardAmt == 0 ? firstFlopRound.getWACardAmount() : waCardAmt;
                     // Second flop round bet amount is 0 then WA card is depend on Big blind amount
                     waCardAmt = waCardAmt == 0 ? smallBlindAmount * 2 : waCardAmt;
                     // If player have not enough balance then WA card is based on player balance
                     PlayerBean loginPlayer = playersManager.getPlayerFromName(appwarp.username);
                     if (loginPlayer.getBalance() < waCardAmt)
                     {
                         waCardAmt = loginPlayer.getBalance();
                     }
                     if (currentPlayer.isAllInPlayer())
                     {
                         txtWATitle.text = "Buy WhoopAss Card for FREE.";
                     }
                     else
                     {
                         txtWATitle.text = "Buy WhoopAss Card for " + Utility.GetCurrencyPrefix() + waCardAmt;
                     }
                     waPurchaseOption.SetActive(true);
                 }
             }
             else
             {
                 if (currentPlayer.isFoldedPlayer())
                 {
                     sendPlayerActionToServer(0, GameConstant.ACTION_FOLDED);
                 }
                 else if (currentPlayer.isAllInPlayer())
                 {
                     sendPlayerActionToServer(0, GameConstant.ACTION_ALL_IN);
                 }
                 else
                 {
                     setEnableDisableOptions(true);
                 }
             }
         }
         else
         {
             if (currentRound == GameConstant.WA_ROUND_WHOOPASS)
             {
                 waPurchaseOption.SetActive(false);
             }
             else
             {
                 playerBalance = 0;
                 setEnableDisableOptions(false);
             }
         }
     }
 }