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); }
public void addNewPlayerOnTable(int id, string playerName, int balance, string card1, string card2, int gameStatus, int playerStatus, int currentRound) { // playerName = "Player "+playersManager.totalPlayerOnTable (); PlayerBean playerTmp = playersManager.getPlayerFromName(playerName); if (playerTmp == null) { GAME_STATUS = gameStatus; PlayerBean player = new PlayerBean( gameObjectManager.getPlayerGameObject(playersManager.totalPlayerOnTable()), gameObjectManager.getPlayerChipsObject(playersManager.totalPlayerOnTable()), id, playerName, balance, card1, card2, null); player.setBetAmount(0, 0); if (playerStatus == GameConstant.ACTION_FOLDED) { player.setFoldedPlayer(true); } else if (playerStatus == GameConstant.ACTION_WAITING_FOR_GAME) { player.setIsWatingForGamePlayer(); playersManager.closeActivePlayersCards(); } if (currentRound > GameConstant.TEXASS_ROUND_PREFLOP) { openRoundCards(currentRound); } gameObjectManager.getPlayerChipsObject(playersManager.totalPlayerOnTable()).SetActive(false); playersManager.addPlayer(player); // handleAnim.GetInstanceCardAnimation ().MoveObject (movingCoinObject, player.getBetChipsObject().gameObject); } else { // playerTmp.setCardsAndBalance (balance, card1, card2, null); } if (playersManager.getAllPlayers().Count < GameConstant.MIN_PLAYER_TO_START_GAME) { waitingForMinPlayer(); } }
public void addNewPlayerOnTable(int id, string playerName, int balance, string card1, string card2, string waCard, int gameStatus, int playerStatus) { PlayerBean playerTmp = playersManager.getPlayerFromName(playerName); if (playerTmp == null) { PlayerBean player = new PlayerBean( gameObjectManager.getPlayerGameObject(playersManager.totalPlayerOnTable()), gameObjectManager.getPlayerChipsObject(playersManager.totalPlayerOnTable()), id, playerName, balance, card1, card2, waCard); player.setBetAmount(0, 0); if (playerStatus == GameConstant.ACTION_FOLDED) { player.setFoldedPlayer(true); } else if (playerStatus == GameConstant.ACTION_WAITING_FOR_GAME) { player.setIsWatingForGamePlayer(); playersManager.closeActivePlayersCards(); } playersManager.addPlayer(player); } else { playerTmp.setCardsAndBalance(balance, card1, card2, waCard); } if (playersManager.getAllPlayers().Count < GameConstant.MIN_PLAYER_TO_START_GAME) { waitingForMinPlayer(); } }
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); }