|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsolitaire.GuiCard
public class GuiCard
Simple, minimal class that implements the IGuiCard interface. This isn't a functional card class in terms of being useful in a game (e.g., there's no way to determine suit or rank directly, not comparable, and so on).
Objects of this class are used in the example programs (solitaire.example package) to show how the Solitaire package works, not as an example of how to implement cards for real games.
Field Summary |
---|
Fields inherited from interface solitaire.IGuiCard |
---|
CLUBS, DIAMONDS, HEARTS, rankPrefixes, SPADES, suitPrefixes |
Constructor Summary | |
---|---|
GuiCard(int rank,
int suit)
Construct card with rank and suit. |
Method Summary | |
---|---|
java.lang.String |
getCardId()
Return a card ID based on the IGuiCard contract. |
boolean |
isFaceUp()
Return whether this card is face up. |
void |
setFaceUp(boolean isup)
Set state of face-up, true means face-up, false means face down. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GuiCard(int rank, int suit)
rank
- is 0 (ace) to 12 (king)suit
- is 0 (spades) to 3 (diamonds)for ranks and suits
Method Detail |
---|
public java.lang.String getCardId()
getCardId
in interface IGuiCard
IGuiCard
public boolean isFaceUp()
isFaceUp
in interface IGuiCard
public void setFaceUp(boolean isup)
isup
- has value true if card is up, else card is down
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |