Examples of PokerAction


Examples of com.barrybecker4.game.multiplayer.poker.model.PokerAction

            action = PokerAction.Name.RAISE;
            raise = getRaise(pc);
        } else {
            action = PokerAction.Name.FOLD;
        }
        return new PokerAction(getName(), action, raise);
    }
View Full Code Here

Examples of com.barrybecker4.game.multiplayer.poker.model.PokerAction

        } else if (getHandScore().compareTo(LOW_THRESHOLD_SCORE) > 0 || Math.random() > 0.5 || allOthersFolded(pc)) {
            action =  PokerAction.Name.CALL;
        } else {
            action = PokerAction.Name.FOLD;
        }
        return new PokerAction(getName(), action, raise);
    }
View Full Code Here

Examples of com.barrybecker4.game.multiplayer.poker.model.PokerAction

        } else if (getHandScore().compareTo(LOW_THRESHOLD_SCORE) > 0 || Math.random() > 0.2 || allOthersFolded(pc)) {
            action =  PokerAction.Name.CALL;
        } else {
            action = PokerAction.Name.FOLD;
        }
        return new PokerAction(getName(), action, raise);
    }
View Full Code Here

Examples of com.barrybecker4.game.multiplayer.poker.model.PokerAction

     * @return an appropriate action based on the situation
     */
    @Override
    public PlayerAction getAction(MultiGameController controller) {

        PokerAction a;
        if (action_ == null) {
            a = createAction((PokerController) controller);
        }
        else {
            a = action_;
View Full Code Here

Examples of com.barrybecker4.game.multiplayer.poker.model.PokerAction

        }
        else {
            assert false :"actionPerformed source="+source+". not recognized";
        }

        player_.setAction(new PokerAction(player_.getName(), actionName, raiseAmount_));
    }
View Full Code Here

Examples of com.barrybecker4.game.multiplayer.poker.model.PokerAction

           BettingDialog bettingDialog = new BettingDialog(pc, getParent());

           boolean canceled = bettingDialog.showDialog();
           if ( !canceled ) {
               PokerAction action = (PokerAction)currentPlayer.getAction(pc);
               applyPokerAction(action, currentPlayer);

               pc.advanceToNextPlayer();
           }
        }
View Full Code Here

Examples of com.barrybecker4.game.multiplayer.poker.model.PokerAction

     */
    @Override
    protected String applyAction(PlayerAction action,  Player player) {

        PokerPlayer p = (PokerPlayer) player;
        PokerAction act = (PokerAction) action;
        PokerController pc = (PokerController) controller_;

        String msg = null;
        int callAmount = pc.getCurrentMaxContribution() - p.getContribution();
        PokerRound round = pc.getRound();

        switch (act.getActionName()) {
            case FOLD :
                p.setFold(true);
                msg = p.getName() + " folded.";
                break;
            case CALL :
                // GameContext.log(0,"PGV: robot call amount = currentMaxContrib - robot.getContrib) = "
                //                   + pc.getCurrentMaxContribution()+" - "+robot.getContribution());
                if (callAmount <= p.getCash())  {
                    p.contributeToPot(round, callAmount);
                    msg = p.getName() + " has called by adding "+ callAmount + " to the pot.";
                } else {
                    p.setFold(true);
                    msg = p.getName() + " folded.";
                }
                break;
            case RAISE :
                p.contributeToPot(round, callAmount);
                int raise = act.getRaiseAmount();
                p.contributeToPot(round, raise);
                msg = p.getName() + " has met the " + callAmount + ", and rasied the pot by " + raise;
                break;
        }
        return msg;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.