Class UserPigPlayer

java.lang.Object
  extended by UserPigPlayer
All Implemented Interfaces:
PigPlayer

public class UserPigPlayer
extends java.lang.Object
implements PigPlayer

UserPigPlayer - text interface to query user for roll/hold decisions


Constructor Summary
UserPigPlayer()
          Creates a new UserPigPlayer instance to allow user play via standard input
Output format: Print an instruction line "Enter nothing to roll; enter anything to hold."
 
Method Summary
 boolean isRolling(int myScore, int otherScore, int turnTotal)
          isRolling - return whether or not the player rolls, given the current game state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserPigPlayer

public UserPigPlayer()
Creates a new UserPigPlayer instance to allow user play via standard input
Output format:

Method Detail

isRolling

public boolean isRolling(int myScore,
                         int otherScore,
                         int turnTotal)
isRolling - return whether or not the player rolls, given the current game state.
Output format: Input format:

Specified by:
isRolling in interface PigPlayer
Parameters:
myScore - an int value - the player's score
otherScore - an int value - the opponent's score
turnTotal - an int value - the player's current turn total
Returns:
a boolean value - whether or not the player will continue to roll