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.

Courchevel.java 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738
  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.Deck;
  9. /**
  10. * Implements a standard (local) Courchevel game.
  11. *
  12. * @author Chris
  13. */
  14. public class Courchevel extends OmahaHoldEm {
  15. public Courchevel(int numplayers, int bigblind, int ante, int raises) {
  16. super(numplayers, bigblind, ante, raises);
  17. }
  18. @Override
  19. public Deck getCommunityCards() {
  20. if (community.isEmpty()) {
  21. return new Deck();
  22. } else if (!doneFlop || community.size() < 3) {
  23. return new Deck(community.subList(0, 1));
  24. } else if (!doneTurn || community.size() < 4) {
  25. return new Deck(community.subList(0, 3));
  26. } else if (!doneRiver || community.size() < 5) {
  27. return new Deck(community.subList(0, 4));
  28. } else {
  29. return new Deck(community);
  30. }
  31. }
  32. }