de.palmmedia.yahtzee.game.elements
Class Straight

java.lang.Object
  extended by de.palmmedia.yahtzee.game.elements.Element
      extended by de.palmmedia.yahtzee.game.elements.Straight
Direct Known Subclasses:
LargeStraight, SmallStraight

public abstract class Straight
extends Element

Element with a certain number of dices in a row.

Author:
Daniel Palme

Field Summary
private  int count
           
 
Constructor Summary
Straight(String name, int count)
          Constructor.
 
Method Summary
 boolean areDicesAllowed(Dice[] dices)
          Determines whether the dices can be applied to the element.
 
Methods inherited from class de.palmmedia.yahtzee.game.elements.Element
calculate, calculateResult, doDicesFit, getName, getResult, hasResult, setDices, unsetDices
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

count

private int count
Constructor Detail

Straight

public Straight(String name,
                int count)
Constructor.

Parameters:
name - The name.
count - The count.
Method Detail

areDicesAllowed

public boolean areDicesAllowed(Dice[] dices)
Determines whether the dices can be applied to the element.

Specified by:
areDicesAllowed in class Element
Parameters:
dices - The dices.
Returns:
The fit state.