|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--Die
The Die class represents a die for games of chance using dice. Bugs: none known
| Constructor Summary | |
Die()
Constructs a 6 sided die with 1 facing up. |
|
Die(int specifiedSides)
Constructs a die of a specified number of sides with 1 facing up. |
|
Die(int specifiedSides,
int specifiedTop)
Constructs a die of a given number of sides and side facing up. |
|
| Method Summary | |
int |
getTop()
Gets die's side facing up. |
void |
roll()
Randomly sets the die's side facing up to be: 1 <= top <= sides. |
void |
setTop(int specifiedTop)
Sets die's side facing up to specified value. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public Die()
public Die(int specifiedSides)
givenSides - die's number of sides, assumed to be > 0
public Die(int specifiedSides,
int specifiedTop)
specifiedSides - die's number of sides, assumed to be > 0specifiedTop - die's side facing up, assumed to be > 0
restricts top <= sides| Method Detail |
public void setTop(int specifiedTop)
specifiedTop - die's side facing up, assumed to be > 0
restricts top <= sidespublic int getTop()
public void roll()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||