public class DicePool
extends java.lang.Object
Constructor and Description |
---|
DicePool()
Default constructor makes no dice.
|
DicePool(int numberOfDice,
int maxValue)
Sets up a dice pool with a specific amount.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addDice(int numberOfDice,
int maxValue)
Add a set of dice.
|
boolean |
addDie(int maxValue)
Adds one die at one specific value.
|
boolean |
areAllDiceHeld()
This is important in Zilch because we need to know if all of the dice are held.
|
java.util.List<java.util.List<Die>> |
diceByLastValue()
Returns a list of dice of a certain value.
|
java.util.List<Die> |
getAllDice() |
int |
getMaxValue() |
boolean |
isMixedPool()
If this is set to true then it means the dice pool is heterogenous; or, in other words, the pool has dice that have different ranges
|
boolean |
removeAllAtMaxValue(int maxValue) |
boolean |
removeAllDice() |
boolean |
removeDie(Die d)
Removes the Die using the reference to the Die.
|
void |
rollAll()
Issues roll to the collection of dice
|
void |
setAllHold(boolean hold)
Issues setHold to all dice.
|
int |
size()
Returns the number of dice in the dice pool
|
java.lang.String |
toString()
A basic toString that will print out all of the values of last rolls in no particular order.
|
int[] |
totalsByValue()
Returns a table of totals in an int[] array.
|
public DicePool()
public DicePool(int numberOfDice, int maxValue)
numberOfDice
- Number of dice in dice poolmaxValue
- The maximum value the dice can achieve in this initial setpublic boolean addDice(int numberOfDice, int maxValue)
numberOfDice
- number of dice to be added.maxValue
- the max value of the dice to be added.public boolean addDie(int maxValue)
maxValue
- The highest the die can be rolled atpublic boolean areAllDiceHeld()
public java.util.List<java.util.List<Die>> diceByLastValue()
public java.util.List<Die> getAllDice()
public int getMaxValue()
public boolean isMixedPool()
public void rollAll()
public boolean removeAllAtMaxValue(int maxValue)
public boolean removeAllDice()
public boolean removeDie(Die d)
d
- The die you want to remove from the listpublic void setAllHold(boolean hold)
public int size()
public int[] totalsByValue()
public java.lang.String toString()
toString
in class java.lang.Object