|
PokerSource Java API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pokersource.game.Deck
public class Deck
Some utilities for working with cards and cardmasks in a way that is consistent with all decks used by the poker-eval C library. We use the joker deck because it is a superset of the other decks.
Field Summary | |
---|---|
static int |
RANK_2
|
static int |
RANK_3
|
static int |
RANK_4
|
static int |
RANK_5
|
static int |
RANK_6
|
static int |
RANK_7
|
static int |
RANK_8
|
static int |
RANK_9
|
static int |
RANK_ACE
|
static int |
RANK_COUNT
|
static int |
RANK_JACK
|
static int |
RANK_JOKER
|
static int |
RANK_KING
|
static int |
RANK_QUEEN
|
static int |
RANK_TEN
|
static int |
SUIT_CLUBS
|
static int |
SUIT_COUNT
|
static int |
SUIT_DIAMONDS
|
static int |
SUIT_HEARTS
|
static int |
SUIT_JOKER
|
static int |
SUIT_SPADES
|
Method Summary | |
---|---|
static java.lang.String |
cardMaskString(long mask)
Returns a string like "Ac Td 2h" representing the cards in mask. |
static java.lang.String |
cardMaskString(long mask,
java.lang.String delim)
Returns a string like "Ac Td 2h" representing the cards in mask. |
static java.lang.String |
cardString(int rank,
int suit)
Returns a string like "Ac", "Td", or "2h" representing the card. |
static int |
createCardIndex(int rank,
int suit)
Returns a number between 0 and 52 denoting the card index within the deck. |
static long |
createCardMask(int[] ranks,
int[] suits)
Returns a long integer with one bit set for each card present in the ranks/suits arrays. |
static long |
createCardMask(int rank,
int suit)
Returns a long integer with one bit set corresponding to the card index. |
static int |
numCards(long mask)
|
static long |
parseCardMask(java.lang.String maskstr)
Returns a long integer with one bit set for each card present in the input string. |
static int |
parseRank(java.lang.String rankstr)
|
static int |
parseSuit(java.lang.String suitstr)
|
static java.lang.String |
rankString(int rank)
|
static java.lang.String |
suitString(int suit)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int SUIT_HEARTS
public static int SUIT_DIAMONDS
public static int SUIT_CLUBS
public static int SUIT_SPADES
public static int SUIT_COUNT
public static int RANK_2
public static int RANK_3
public static int RANK_4
public static int RANK_5
public static int RANK_6
public static int RANK_7
public static int RANK_8
public static int RANK_9
public static int RANK_TEN
public static int RANK_JACK
public static int RANK_QUEEN
public static int RANK_KING
public static int RANK_ACE
public static int RANK_COUNT
public static int RANK_JOKER
public static int SUIT_JOKER
Method Detail |
---|
public static int createCardIndex(int rank, int suit)
rank
- The rank of the cardsuit
- The suit of the card
public static long createCardMask(int rank, int suit)
rank
- The rank of the cardsuit
- The suit of the card
public static long createCardMask(int[] ranks, int[] suits)
ranks
- ranks[i] is the rank of the ith cardsuits
- suits[i] is the suit of the ith card
public static long parseCardMask(java.lang.String maskstr)
maskstr
- One or more cards, e.g., "Ac Td 2h" (whitespace optional)
public static java.lang.String cardString(int rank, int suit)
rank
- The rank of the cardsuit
- The suit of the card
public static int parseRank(java.lang.String rankstr)
public static int parseSuit(java.lang.String suitstr)
public static java.lang.String rankString(int rank)
public static java.lang.String suitString(int suit)
public static java.lang.String cardMaskString(long mask, java.lang.String delim)
mask
- The bitmask of cards in the hand (from createCardMask())delim
- Delimiter to insert between each card (example above uses " ")
public static java.lang.String cardMaskString(long mask)
mask
- The bitmask of cards in the hand (from createCardMask())
public static int numCards(long mask)
|
PokerSource Java API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |