public class ComputerPigPlayer extends PigPlayer
Constructor and Description |
---|
ComputerPigPlayer(String name)
The main constructor for
ComputerPigPlayer . |
Modifier and Type | Method and Description |
---|---|
void |
beginTurn(int myScore,
int opponentsScore)
This function does nothing.
|
boolean |
decideIfShouldRoll(int turnNumber,
int rollNumber,
int poolSize,
int myScore,
int opponentsScore)
Should the player roll again? The computer always rolls once.
|
public ComputerPigPlayer(String name)
ComputerPigPlayer
.name
- The ComputerPigPlayer
's namepublic void beginTurn(int myScore, int opponentsScore)
PigPlayer
class.public boolean decideIfShouldRoll(int turnNumber, int rollNumber, int poolSize, int myScore, int opponentsScore)
decideIfShouldRoll
in class PigPlayer
turnNumber
- which turn the player is on (unused)rollNumber
- which roll the player is onpoolSize
- the number of points currently in the pool (unused)myScore
- the number of points the player has already won (unused)opponentsScore
- the number of points the opponent has already won
(unused)