Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. package model.card;
  2.  
  3. /**
  4. * This enum represent the rank for each card
  5. *
  6. * <p>
  7. * The natural order of rank should be Ace, 2, 3, ... 9, 10, Jack, Queen, King
  8. *
  9. * <p>
  10. * <b>Note: </b>You must provide the method {@link Rank#getRankValue()} in the
  11. * enum and/or for each of it's values.
  12. *
  13. * <p>
  14. * <b>Hint: </b>You may find it useful to override methods in the enum and/or
  15. * on each of the value.
  16. *
  17. * <p>
  18. * <b>Hint: </b>Be sure to follow naming conventions for your enum values
  19. *
  20. * <p>
  21. * <b>Note: </b> The {@link Rank#valueOf(String)} and {@link Rank#values()}
  22. * methods are provided by the API - you do not need to write or override them
  23. * yourself.
  24. *
  25. * @author Ross Nye
  26. *
  27. * @see model.card.Card
  28. * @see model.card.Suit
  29. *
  30. */
  31. public enum Rank
  32. {
  33.  
  34. ACE(1), TWO(2), THREE(3), FOUR(4), FIVE(5), SIX(6), SEVEN(7), EIGHT(8), NINE(9), TEN(10), JACK(10), QUEEN(10), KING(10);
  35.  
  36. private int value;
  37.  
  38. Rank(int v)
  39. {
  40. value = v;
  41. }
  42.  
  43. public int getRankValue() {
  44. return value;
  45. }
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement