Examples of PokerHandScorer


Examples of com.barrybecker4.game.multiplayer.poker.hand.PokerHandScorer

        }
        if (((PokerPlayer)players.get(first)).hasFolded())
            GameContext.log(0, "All players have folded. That was dumb. The winner will be random.");

        Hand bestHand = ((PokerPlayer) players.get(first)).getHand();
        PokerHandScorer scorer = new PokerHandScorer();
        HandScore bestScore = scorer.getScore(bestHand);

        // find the best hand
        for (int i = first + 1; i < players.size(); i++) {
            PokerPlayer player = (PokerPlayer) players.get(i).getActualPlayer();
            HandScore score = scorer.getScore(player.getHand());
            if (!player.hasFolded() && score.compareTo(bestScore) > 0) {
                bestScore = score;
            }
        }

        // find all players with a hand that good (rare that there will be more than one
        for (int i = first; i < players.size(); i++) {
            PokerPlayer player = (PokerPlayer) players.get(i).getActualPlayer();
            if (!player.hasFolded() && scorer.getScore(player.getHand()).compareTo(bestScore) == 0) {
                winners.add(player);
            }
        }

        GameContext.log(0, "The winning players were " + winners);
View Full Code Here

Examples of com.barrybecker4.game.multiplayer.poker.hand.PokerHandScorer

        return handScore_;
    }

    public void setHand( Hand hand ) {
        this.hand_ = hand;
        this.handScore_ = new PokerHandScorer().getScore(hand);
    }
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.