Exemplo n.º 1
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.TEXASS_ROUND_PREFLOP && playerBean.isBigBlindPlayer())
        {
            totalBBPlayersTurn++;
        }

        if (!playerBean.isWaitingForGame())
        {
            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;
        }
//		Debug.Log ("Player Moved : " + playerBean.getPlayerName () + " >> Action >> " + action + " >> " + betamount);
        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);
//		playersManager.setPlayerBetAmount (playerBean, betamount, totalBetAmtInRound, totalPlayerBalance);
        setTotalBetTableAmount(totalTableAmount);
        //currentRoundTurns.Add (turnManager);
    }
Exemplo n.º 2
0
    public IEnumerator manageWinnerPlayers(PlayerBean winnerPlayer)
    {
        gameObjectManager.getTableChipSetPositionObject().SetActive(true);
        gameObjectManager.getTableChipSetObject().transform.position = gameObjectManager.getTableChipSetPositionObject().transform.position;
        animationManager.MoveChipsObject(gameObjectManager.getTableChipSetObject(), winnerPlayer.getChipObject());
        yield return(new WaitForSeconds(GameConstant.ANIM_WAITING_TIME));

        winnerPlayer.getChipObject().transform.position = winnerPlayer.getChipPositionObject().transform.position;
        gameObjectManager.getTableChipSetObject().transform.position = gameObjectManager.getTableChipSetPositionObject().transform.position;
        gameObjectManager.getTableChipSetPositionObject().SetActive(false);
        gameObjectManager.getTableChipSetObject().SetActive(false);
        StartCoroutine(blinkWinnerPlayer(winnerPlayer.getGameObject()));
    }
Exemplo n.º 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);
    }