|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectknockabout.gamemodel.Die
The Knockabout Die Class Represents a game die. Each game die has a set number of sides and color. Each die also has an (x,y) positional coordinate indicating it's position on a GameBoard. The current value will vary throughout the game, and range between 1 and the number of die sides.
Constructor Summary | |
Die(int _color,
int _sides,
int _curval)
Note that no validation is done on any of these field. |
Method Summary | |
int |
curVal()
Returns the current value of the game die. |
Die |
deepclone()
|
int |
getColor()
Returns the player's color code (see class Player) See class description about validation issues |
int |
getSides()
Returns the number of sides on the die. |
int |
getX()
|
int |
getY()
|
void |
setVal(int _val)
|
void |
setX(int i)
|
void |
setY(int i)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Die(int _color, int _sides, int _curval)
_color
- The color code, see Player class_sides
- The number of sides on the die. MUST be one of {4, 6, 8} to conform the Board class fast acces fields_curval
- The current value on the dieMethod Detail |
public int curVal()
public int getSides()
public int getColor()
public void setVal(int _val)
public Die deepclone()
public int getX()
public int getY()
public void setX(int i)
i
- public void setY(int i)
i
- public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |