Class Player

java.lang.Object
  |
  +--Player

public class Player
extends java.lang.Object

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

See Also:
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

Player

public Player(int playerNumber)
Player's constructor take in the identifying player number.

Parameters:
playerNumber - the identification number of the player, used to distinguish between players during output.
Method Detail

getDone

public boolean getDone()
A boolean accessor for the done variable

Returns:
the status of the player for the current hole

newHole

public void newHole()
a way for the player to "advance" to the next hole


putt

public void putt()
a method that makes the player putt for the hole. If the randomly generated number is greater than the threshold, then the player will declare himself done. Otherwise, the player declares himself not done.