|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jogre.common.comm.CommGameMessage org.jogre.common.comm.CommTableMessage org.jogre.common.games.Deck
Field Summary | |
static String |
XML_ATT_POSITION
|
static String |
XML_NAME
|
Fields inherited from class org.jogre.common.comm.CommTableMessage |
NO_TABLE, tableNum, XML_ATT_TABLE_NUM |
Fields inherited from class org.jogre.common.comm.CommGameMessage |
status, username, usernameTo, XML_ATT_STATUS, XML_ATT_USERNAME, XML_ATT_USERNAME_TO |
Constructor Summary | |
Deck()
Default constructor |
|
Deck(XMLElement message)
Contructor that takes a xml message |
Method Summary | |
boolean |
addCard(Card card)
Adds card to deck. |
int |
cardsLeft()
Gets number of cards left in deck. |
Card |
deal()
Dealing a card removes a card off the top of the deck. |
XMLElement |
flatten()
Flatten this object. |
Card |
get(int index)
Get card from deck by index |
Vector |
getCards()
Getter for getting all the cards in the deck. |
void |
loadStandardDeck()
Adds the standard 52 cards to the deck. |
void |
shuffle()
Shuffles the deck one time. |
int |
size()
Gets the number of cards in the deck. |
void |
sort()
Sorts the deck by suit, then by card order value. |
String |
toString()
A string representation of the deck of cards. |
Methods inherited from class org.jogre.common.comm.CommTableMessage |
flatten, getTableNum, setTableNum |
Methods inherited from class org.jogre.common.comm.CommGameMessage |
getStatus, getUsername, getUsernameTo, isUsernameSet, isUsernameToSet, setUsername, setUsernameTo |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String XML_NAME
public static final String XML_ATT_POSITION
Constructor Detail |
public Deck()
public Deck(XMLElement message)
message
-
TransmissionException
Method Detail |
public Vector getCards()
public Card deal()
public Card get(int index)
index
- Index in deck
public void shuffle()
public int cardsLeft()
public boolean addCard(Card card)
card
- Card
public int size()
public void loadStandardDeck()
public void sort()
public String toString()
toString
in class CommGameMessage
Object.toString()
public XMLElement flatten()
ITransmittable.flatten()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |