Class Combination

java.lang.Object
  extended by Combination

public class Combination
extends java.lang.Object


Constructor Summary
Combination(int die1, int die2, int die3)
          Constructs a new Combination from the given dice values.
 
Method Summary
 int calculateScore()
          Calculates the score for this roll.
 boolean isScoring()
          Returns true if this roll represents a scoring combination as detailed in the rules.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Combination

public Combination(int die1,
                   int die2,
                   int die3)
Constructs a new Combination from the given dice values.

Parameters:
die1 - the first die value
die2 - the second die value
die3 - the third die value
Method Detail

isScoring

public boolean isScoring()
Returns true if this roll represents a scoring combination as detailed in the rules. (That is, either a ground, a top, a pair, or a triple.)

Returns:
true if this roll represents a scoring combination, and false otherwise.

calculateScore

public int calculateScore()
Calculates the score for this roll. This method will use the following values for roll scores:
Preconditon: isScoring() returns true.

Returns:
the score for this roll.