blob: 62ca151717752c460aa272b225637b6cb5a613ac (
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
32
33
34
35
36
37
38
39
40
41
42
43
44
|
package bjc.dicelang.v1;
/**
* A die that represents a static number
*
* @author ben
*
*/
public class ScalarDie implements IDiceExpression {
/*
* The represented number
*/
private int number;
/**
* Create a dice with the specified number
*
* @param num
* The number used for the dice
*/
public ScalarDie(int num) {
this.number = num;
}
@Override
public boolean canOptimize() {
return true;
}
@Override
public int optimize() {
return number;
}
@Override
public int roll() {
return number;
}
@Override
public String toString() {
return Integer.toString(number);
}
}
|