public abstract class PigPlayer extends Object
HumanPigPlayer
) must
extend this class.Constructor and Description |
---|
PigPlayer(String name)
The main constructor for
PigPlayer . |
Modifier and Type | Method and Description |
---|---|
abstract void |
beginTurn(int myScore,
int opponentsScore)
Alert the
PigPlayer that its turn is beginning. |
abstract boolean |
decideIfShouldRoll(int turnNumber,
int rollNumber,
int poolSize,
int myScore,
int opponentsScore)
Should the
PigPlayer roll again? This method needs to be
implemented in the subclass, taking the exact same arguments (even though
some of them may be unused). |
String |
getName()
Accessor for the
PigPlayer 's name. |
public PigPlayer(String name)
PigPlayer
.name
- The PigPlayer
's namepublic String getName()
PigPlayer
's name.PigPlayer
's namepublic abstract void beginTurn(int myScore, int opponentsScore)
PigPlayer
that its turn is beginning. This method
needs to be implemented in the subclass (even if it is an empty
function).myScore
- the player's current scoreopponentsScore
- the opponent's current scorepublic abstract boolean decideIfShouldRoll(int turnNumber, int rollNumber, int poolSize, int myScore, int opponentsScore)
PigPlayer
roll again? This method needs to be
implemented in the subclass, taking the exact same arguments (even though
some of them may be unused).turnNumber
- which turn the player is on (0-indexed)rollNumber
- which roll the player is on (0-indexed)poolSize
- the number of points currently in the poolmyScore
- the number of points the player has already wonopponentsScore
- the number of points the opponent has already won