-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDiceSetup.java
More file actions
40 lines (36 loc) · 823 Bytes
/
Copy pathDiceSetup.java
File metadata and controls
40 lines (36 loc) · 823 Bytes
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
import java.util.ArrayList;
/**
* DiceSetup - Defines setups with multiple dice
*
* @author Even A. Nilsen
* @version v0.1 11.05.2015
*/
public class DiceSetup
{
private ArrayList<Die> dice;
private int amount;
private int mod;
private String label;
/**
* Default constructor
*/
public DiceSetup() {
dice = new ArrayList<Die>();
mod = 0;
amount = 0;
label = "";
}
/**
*
*/
protected void addDie(int amount, int nSides, int mod) {
for(int i = 0; i < amount; i++) {
dice.add(new Die(nSides));
}
}
protected void addLabel(int amount, String label, int mod) {
String a = String.valueOf(amount);
String m = String.valueOf(mod);
System.out.println(a + label + m);
}
}