|
|||||||||||
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.Card
Card defines a generic playing card that is transmittable
Field Summary | |
static String |
ACE
|
static int |
CARD_PIXEL_HEIGHT
|
static int |
CARD_PIXEL_WIDTH
|
static int |
CARD_SPACING
|
static Image |
cardImages
|
static int[] |
cardIntOrderValues
|
static int[] |
cardIntValues
|
static String[] |
cardStringValues
|
static char |
CLUB
|
static char |
DIAMOND
|
static String |
EIGHT
|
static String |
FIVE
|
static String |
FOUR
|
static char |
HEART
|
static String |
JACK
|
static String |
KING
|
static String |
NINE
|
static String |
QUEEN
|
static String |
SEVEN
|
static String |
SIX
|
static char |
SPADE
|
static String |
TEN
|
static String |
THREE
|
static String |
TWO
|
static String |
XML_ATT_CARD_FACE_UP
|
static String |
XML_ATT_CARD_INT_VALUE
|
static String |
XML_ATT_CARD_STRING_VALUE
|
static String |
XML_ATT_CARD_SUIT
|
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 | |
Card()
Default constructor |
|
Card(String card,
int value,
char suit)
Constructor that takes card value. |
|
Card(XMLElement message)
Contructor that takes an xml message |
Method Summary | |
int |
compareTo(Object obj)
Compares two Card objects based on card value. |
boolean |
equals(Object obj)
Tells whether two cards are equal or not. |
XMLElement |
flatten()
Flatten this object. |
String |
getCard()
Getter for card string value. |
int |
getOrderValue()
Get order value of card. |
char |
getSuit()
Getter for the string value of the card suit. |
int |
getValue()
Getter for the integer value of the card. |
boolean |
isFaceUp()
Getter for if the card is face up. |
void |
paintComponent(Graphics g,
int x,
int y)
|
void |
paintComponent(Graphics g,
int x,
int y,
boolean horizontal)
|
void |
setCard(String card)
Setter for card string value. |
void |
setFaceUp(boolean faceUp)
Setter for if the card is face up or down. |
void |
setSuit(char suit)
Setter for the string value of the card suit. |
void |
setValue(int value)
Setter for the integer value of the card. |
int |
spadesCompareTo(Card card)
Compares two Card objects in the game of spades. |
String |
toString()
Outputs the Card object in a string format |
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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int CARD_PIXEL_HEIGHT
public static final int CARD_PIXEL_WIDTH
public static final int CARD_SPACING
public static Image cardImages
public static final String XML_NAME
public static final String XML_ATT_CARD_SUIT
public static final String XML_ATT_CARD_STRING_VALUE
public static final String XML_ATT_CARD_INT_VALUE
public static final String XML_ATT_CARD_FACE_UP
public static final char CLUB
public static final char SPADE
public static final char DIAMOND
public static final char HEART
public static final String TWO
public static final String THREE
public static final String FOUR
public static final String FIVE
public static final String SIX
public static final String SEVEN
public static final String EIGHT
public static final String NINE
public static final String TEN
public static final String JACK
public static final String QUEEN
public static final String KING
public static final String ACE
public static final String[] cardStringValues
public static final int[] cardIntValues
public static final int[] cardIntOrderValues
Constructor Detail |
public Card()
public Card(String card, int value, char suit)
card
- String value of card.value
- Integer value of cardsuit
- String value of suit of card.public Card(XMLElement message)
message
-
TransmissionException
Method Detail |
public String getCard()
public void setCard(String card)
card
- The card string value to set.public boolean isFaceUp()
public void setFaceUp(boolean faceUp)
faceUp
- Sets whether or not the card is face up or not.public char getSuit()
public void setSuit(char suit)
suit
- The suit to set.public int getValue()
public void setValue(int value)
value
- The value to set.public int getOrderValue()
public int spadesCompareTo(Card card)
public int compareTo(Object obj)
compareTo
in interface Comparable
obj
- The Card object to compare to.
public boolean equals(Object obj)
Object.equals(java.lang.Object)
public String toString()
toString
in class CommGameMessage
Object.toString()
public XMLElement flatten()
flatten
in interface ITransmittable
ITransmittable.flatten()
public void paintComponent(Graphics g, int x, int y)
public void paintComponent(Graphics g, int x, int y, boolean horizontal)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |