solitaire
Class GuiCard

java.lang.Object
  extended by solitaire.GuiCard
All Implemented Interfaces:
IGuiCard

public class GuiCard
extends java.lang.Object
implements IGuiCard

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

GuiCard

public GuiCard(int rank,
               int suit)
Construct card with rank and suit.

Parameters:
rank - is 0 (ace) to 12 (king)
suit - is 0 (spades) to 3 (diamonds)
See Also:
for ranks and suits
Method Detail

getCardId

public java.lang.String getCardId()
Return a card ID based on the IGuiCard contract.

Specified by:
getCardId in interface IGuiCard
Returns:
this card's ID
See Also:
IGuiCard

isFaceUp

public boolean isFaceUp()
Return whether this card is face up.

Specified by:
isFaceUp in interface IGuiCard
Returns:
true if this card is face up, else false

setFaceUp

public void setFaceUp(boolean isup)
Set state of face-up, true means face-up, false means face down.

Parameters:
isup - has value true if card is up, else card is down