public void NotifyOnResponse(PokerPlayer player, PokerPlayer.PokerResponse response)
        {
            if (stage == GameStage.PLAYER_TURN && player == HumanPlayer)
            {
                if (response == PokerPlayer.PokerResponse.RAISE)
                {
                    player.Money -= 10;
                    Pot          += 10;
                    if (GameListener != null)
                    {
                        GameListener.OnPlayerResponse(response);
                    }

                    sendRoboTurn();
                }
                else
                {
                    if (GameListener != null)
                    {
                        GameListener.OnPlayerResponse(response);
                    }
                    distributePot(WinStatus.PLAYER_ROBO);
                }
            }
            else if (stage == GameStage.OPPONENT_TURN && player == RoboPlayer)
            {
                if (response == PokerPlayer.PokerResponse.RAISE)
                {
                    RoboPlayer.Money -= 10;
                    Pot += 10;

                    int       compare = HumanPlayer.Hand.CompareTo(RoboPlayer.Hand);
                    WinStatus win;

                    if (compare > 0)
                    {
                        win = WinStatus.PLAYER_HUMAN;
                    }
                    else if (compare < 0)
                    {
                        win = WinStatus.PLAYER_ROBO;
                    }
                    else
                    {
                        win = WinStatus.TIE;
                    }

                    if (GameListener != null)
                    {
                        GameListener.OnOpponentResponse(response);
                    }

                    distributePot(win);
                }
                else
                {
                    if (GameListener != null)
                    {
                        GameListener.OnOpponentResponse(response);
                    }
                    distributePot(WinStatus.PLAYER_HUMAN);
                }
            }
        }
Example #2
0
 public void OnOpponentResponse(PokerPlayer.PokerResponse response)
 {
     mainUpdate();
     showCpuInfo();
     writeCpuAction(response);
 }
Example #3
0
 private void writeCpuAction(PokerPlayer.PokerResponse resp)
 {
     writeActionLabel(OpActionLabel, resp);
 }
Example #4
0
 public void OnPlayerResponse(PokerPlayer.PokerResponse response)
 {
     mainUpdate();
     disablePlayerResponse();
     writePlayerAction(response);
 }