|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.palmmedia.yahtzee.game.elements.Element
public abstract class Element
Represents an element.
Field Summary | |
---|---|
private String |
name
The name of the element. |
private Integer |
result
The result. |
Constructor Summary | |
---|---|
protected |
Element(String name)
Constructor. |
Method Summary | |
---|---|
protected abstract boolean |
areDicesAllowed(Dice[] dices)
Determines whether the dices can be applied to the element. |
int |
calculate(Dice[] dices)
Calculates the result of the given dices respecting the allowed state. |
protected abstract int |
calculateResult(Dice[] dices)
Calculates the result of the given dices. |
boolean |
doDicesFit(Dice[] dices)
Determines whether the dices fit. |
String |
getName()
Gets the name. |
Integer |
getResult()
Gets the result. |
boolean |
hasResult()
Determines whether the element has a result. |
void |
setDices(Dice[] dices)
Apply the given dices. |
void |
unsetDices()
Reset the element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Integer result
private String name
Constructor Detail |
---|
protected Element(String name)
name
- The name of the element.Method Detail |
---|
public Integer getResult()
public boolean hasResult()
public String getName()
public void unsetDices()
public void setDices(Dice[] dices)
dices
- The dices.public int calculate(Dice[] dices)
dices
- The dices.
public boolean doDicesFit(Dice[] dices)
dices
- The dices.
protected abstract boolean areDicesAllowed(Dice[] dices)
dices
- The dices.
protected abstract int calculateResult(Dice[] dices)
dices
- The dices.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |