com.threerings.parlor.card.data
Class Hand
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<E>
com.threerings.util.StreamableArrayList<Card>
com.threerings.parlor.card.data.Hand
- All Implemented Interfaces:
- Streamable, Serializable, Cloneable, Iterable<Card>, Collection<Card>, List<Card>, RandomAccess
public class Hand
- extends StreamableArrayList<Card>
Instances of this class represent hands of cards.
- See Also:
- Serialized Form
|
Constructor Summary |
Hand()
|
|
Method Summary |
void |
addAll(Card[] cards)
Adds all of the specified cards to this hand. |
boolean |
containsAll(Card[] cards)
Checks whether this hand contains all of the specified cards. |
Card[] |
getCards()
Converts this list of cards into an array. |
int |
getSuitMemberCount(int suit)
Counts the members of a particular suit within this hand. |
void |
removeAll(Card[] cards)
Removes all of the specified cards from this hand. |
| Methods inherited from class java.util.ArrayList |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
Hand
public Hand()
addAll
public void addAll(Card[] cards)
- Adds all of the specified cards to this hand.
removeAll
public void removeAll(Card[] cards)
- Removes all of the specified cards from this hand.
containsAll
public boolean containsAll(Card[] cards)
- Checks whether this hand contains all of the specified cards.
getSuitMemberCount
public int getSuitMemberCount(int suit)
- Counts the members of a particular suit within this hand.
- Parameters:
suit - the suit of interest
- Returns:
- the number of cards in the specified suit
getCards
public Card[] getCards()
- Converts this list of cards into an array. This only necessary if you
need the cards in array form, use
ArrayList.get(int) if you simply need to get
a card from the hand.