de.palmmedia.yahtzee.game.elements
Class OneKind
java.lang.Object
de.palmmedia.yahtzee.game.elements.Element
de.palmmedia.yahtzee.game.elements.OneKind
- Direct Known Subclasses:
- Yahtzee
public class OneKind
- extends Element
Element where a certain number of dices has to be equal.
- Author:
- Daniel Palme
Field Summary |
private int |
count
The count. |
Method Summary |
boolean |
areDicesAllowed(Dice[] dices)
Determines whether the dices can be applied to the element. |
protected int |
calculateResult(Dice[] dices)
Calculates the result of the given dices. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
count
private int count
- The count.
OneKind
public OneKind(String name,
int count)
- Constructor.
- Parameters:
name
- The name.count
- The count.
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.
calculateResult
protected int calculateResult(Dice[] dices)
- Calculates the result of the given dices.
- Specified by:
calculateResult
in class Element
- Parameters:
dices
- The dices.
- Returns:
- The result.