|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectm3g10.Card
public class Card
Data related to a card in the memory game.
| Field Summary | |
|---|---|
private java.lang.String |
description
The card's description. |
private boolean |
isMatched
Flag whether card was succesfully matched. |
private boolean |
isOpen
State of the card. |
private boolean |
isTrigger
Whether this card triggers an action. |
private int |
keyCode
Key code to open/close a card. |
private javax.microedition.m3g.Mesh |
mesh
Mesh object representing the look of the card. |
private static int |
USER_PARAM_DESCRIPTION
User parameter for description. |
private static int |
USER_PARAM_KEYCODE
User parameter for key code. |
private static int |
USER_PARAM_TRIGGER
User parameter for trigger. |
| Constructor Summary | |
|---|---|
Card(javax.microedition.m3g.Mesh mesh)
Creates a new card with information from the mesh's user object. |
|
| Method Summary | |
|---|---|
java.lang.String |
getDescription()
Getter for description. |
int |
getKeyCode()
Getter for key code. |
javax.microedition.m3g.Mesh |
getMesh()
Getter for mesh. |
static boolean |
isCard(javax.microedition.m3g.Object3D object)
Checks whether a scene object is a card. |
boolean |
isMatch(Card card)
Checks if this card pairs with the given card. |
boolean |
isMatched()
Getter for match flag. |
boolean |
isOpen()
Getter for card state. |
boolean |
isTrigger()
Getter for action trigger. |
void |
setKeyCode(int keyCode)
Setter for key code. |
void |
setMatched(boolean isMatched)
Setter for match flag. |
void |
setOpen(boolean isOpen)
Opens (image is visible) or closes (cover is visible) a card. |
void |
swap(Card card)
Swaps places between this card and the given card. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final int USER_PARAM_KEYCODE
private static final int USER_PARAM_DESCRIPTION
private static final int USER_PARAM_TRIGGER
private javax.microedition.m3g.Mesh mesh
private boolean isOpen
private boolean isMatched
private int keyCode
private java.lang.String description
private boolean isTrigger
| Constructor Detail |
|---|
public Card(javax.microedition.m3g.Mesh mesh)
mesh - mesh object of the card.| Method Detail |
|---|
public void setOpen(boolean isOpen)
isOpen - state of the card.public void swap(Card card)
card - second card involved in the process.public boolean isMatch(Card card)
card - second card involved in the process.
public static boolean isCard(javax.microedition.m3g.Object3D object)
object - object to check.
public int getKeyCode()
public void setKeyCode(int keyCode)
keyCode - key code.public java.lang.String getDescription()
public boolean isOpen()
public javax.microedition.m3g.Mesh getMesh()
public boolean isTrigger()
public boolean isMatched()
public void setMatched(boolean isMatched)
isMatched - flag.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||