summaryrefslogtreecommitdiff
path: root/base/src/bjc/dicelang/dice/DieList.java
blob: 48006d46ad0803fa996007ed08235c8f63a20be6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package bjc.dicelang.dice;

/**
 * Represents a group of dice.
 *
 * @author Ben Culkin.
 */
public interface DieList {
	/**
	 * Can this list be optimized?
	 *
	 * @return Whether or not this list can be optimized.
	 */
	boolean canOptimize();

	/**
	 * Optimize this list, if it can be done.
	 *
	 * Invoking this on unoptimizable expression is undefined.
	 *
	 * @return The optimized form of this list.
	 */
	long[] optimize();

	/**
	 * Roll this group of dice.
	 *
	 * @return A possible roll of this group.
	 */
	long[] roll();
}