|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.cb.jset.CardProperties
Represents a card used in the game.
A card has 4 properties: a type, a color, a number of shapes and a number of fills. Each property has 3 different values, making for 81 different cards in the game.
| Field Summary | |
static int |
CARDSNB
Number of cards. |
static int |
COLOR_BLUE
|
static int |
COLOR_GREEN
|
static int |
COLOR_RED
|
static int |
FILL_DOTTED
|
static int |
FILL_EMPTY
|
static int |
FILL_FULL
|
static int |
SHAPE_ODD
|
static int |
SHAPE_OVALE
|
static int |
SHAPE_RECTANGLE
|
| Constructor Summary | |
CardProperties(byte shape,
byte color,
byte number,
byte fill)
Creates a new instance of CardProperties, given the specified shape, color number and fill. |
|
| Method Summary | |
boolean |
equals(java.lang.Object o)
Indicates whether some other object is "equal to" this one. |
static CardProperties |
findCard(CardProperties card)
|
static CardProperties |
getCard(int idx)
Get the card given the specified index. |
byte |
getColor()
|
byte |
getFill()
|
byte |
getNumber()
|
byte |
getShape()
|
int |
hashCode()
|
java.lang.String |
toString()
|
static java.lang.String |
toString(CardProperties[] cards)
A helper function that generates a String representation for the
specified array of CardProperties. |
static java.lang.String |
toString(java.util.List cards)
A helper function that generates a String representation for the
specified list of CardProperties. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int COLOR_RED
public static final int COLOR_GREEN
public static final int COLOR_BLUE
public static final int SHAPE_RECTANGLE
public static final int SHAPE_OVALE
public static final int SHAPE_ODD
public static final int FILL_EMPTY
public static final int FILL_DOTTED
public static final int FILL_FULL
public static final int CARDSNB
| Constructor Detail |
public CardProperties(byte shape,
byte color,
byte number,
byte fill)
1 and 3.
shape - the card shape typecolor - the card color typenumber - the card shape number typefill - the card shape fill type| Method Detail |
public byte getShape()
public byte getColor()
public byte getNumber()
public byte getFill()
public static CardProperties getCard(int idx)
idx - the index of the card.
java.lang.IllegalStateException - if index is invalid.public static CardProperties findCard(CardProperties card)
card -
public boolean equals(java.lang.Object o)
o - the other object
true if both instances are equal.public int hashCode()
public java.lang.String toString()
String representation of that object.public static java.lang.String toString(CardProperties[] cards)
String representation for the
specified array of CardProperties.
cards - the cards for which we want a String representation.
String representationpublic static java.lang.String toString(java.util.List cards)
String representation for the
specified list of CardProperties.
cards - the cards for which we want a String representation.
String representation
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||