Java poker implementation
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

RoyalHoldEm.java 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Copyright (c) Chris 'MD87' Smith, 2007. All rights reserved.
  3. *
  4. * This code may not be redistributed without prior permission from the
  5. * aforementioned copyright holder(s).
  6. */
  7. package com.md87.cardgame.games;
  8. import com.md87.cardgame.Card;
  9. import com.md87.cardgame.Rank;
  10. import com.md87.cardgame.Suit;
  11. import java.util.Collections;
  12. /**
  13. * Implements a standard Royal Hold'Em game.
  14. *
  15. * @author Chris
  16. */
  17. public class RoyalHoldEm extends TexasHoldEm {
  18. /**
  19. * Creates a new instance of RoyalHoldEm.
  20. *
  21. * @param numplayers The number of players who are taking part
  22. * @param bigblind The size of the big blind
  23. * @param ante The size of the ante
  24. * @param raises The maximum number of raises per round
  25. */
  26. public RoyalHoldEm(final int numplayers, final int bigblind, final int ante,
  27. final int raises) {
  28. super(numplayers, bigblind, ante, raises);
  29. this.numplayers = Math.min(6, numplayers);
  30. }
  31. /** {@inheritDoc} */
  32. @Override
  33. protected void shuffle() {
  34. deck.clear();
  35. for (Suit suit : Suit.values()) {
  36. for (Rank rank : Rank.values()) {
  37. if (rank.compareTo(Rank.TEN) <= 0) {
  38. deck.add(new Card(suit, rank));
  39. }
  40. }
  41. }
  42. Collections.shuffle(deck);
  43. }
  44. }