|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Player
The Player class can be instantiated several times to add to a Group, and play can begin. Each player, for the current hole, keeps track of whether or not they have made it into the hole yet. Putting is performed by taking a random number and comparing it to some set threshold value. If the number is above the threshold, then the player "makes" the shot and declares himself done. Bugs: none known
also
Constructor Summary | |
Player(int playerNumber)
Player's constructor take in the identifying player number. |
Method Summary | |
boolean |
getDone()
A boolean accessor for the done variable |
void |
newHole()
a way for the player to "advance" to the next hole |
void |
putt()
a method that makes the player putt for the hole. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Player(int playerNumber)
playerNumber
- the identification number of the player, used
to distinguish between players during output.Method Detail |
public boolean getDone()
public void newHole()
public void putt()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |