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.

GameInfo.java 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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.config.games;
  8. import com.md87.cardgame.interfaces.Game;
  9. import java.io.Serializable;
  10. /**
  11. *
  12. * @author Chris
  13. */
  14. public abstract class GameInfo implements Serializable {
  15. /**
  16. * A version number for this class. It should be changed whenever the class
  17. * structure is changed (or anything else that would prevent serialized
  18. * objects being unserialized with the new class).
  19. */
  20. private static final long serialVersionUID = 1;
  21. public static enum GameType {
  22. STUD, DRAW, HOLDEM
  23. };
  24. public abstract String getName();
  25. public abstract GameType getGameType();
  26. public abstract int getNumPlayers();
  27. public abstract boolean usesBringIns();
  28. public abstract Game getGame(final int numplayers, final int bigblind, final int ante,
  29. final int raises);
  30. public static GameInfo[] getGames() {
  31. return new GameInfo[]{
  32. new TexasHoldEmInfo(),
  33. new PineappleInfo(),
  34. new CrazyPineappleInfo(),
  35. new RoyalHoldEmInfo(),
  36. new SuperHoldEmInfo(),
  37. new OmahaHoldEmInfo(),
  38. new OmahaHighLowInfo(),
  39. new CourchevelInfo(),
  40. new FiveCardDrawInfo(),
  41. new FiveCardStudInfo(),
  42. new SevenCardStudInfo(),
  43. new AsianFiveCardStudInfo(),
  44. };
  45. }
  46. /** {@inheritDoc} */
  47. @Override
  48. public boolean equals(final Object obj) {
  49. return getClass().equals(obj.getClass());
  50. }
  51. /** {@inheritDoc} */
  52. @Override
  53. public int hashCode() {
  54. return getClass().hashCode();
  55. }
  56. }