-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVillage.java
38 lines (27 loc) · 827 Bytes
/
Village.java
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
import java.util.ArrayList;
import Negative.*;
public class Village {
private ArrayList<Villager> villagers = new ArrayList<Villager>();
public Village() {
Villager v;
villagers.add(new Villager(genSettlerAge(), "M"));
villagers.add(new Villager(genSettlerAge(), "F"));
for (int i = 0; i < Utility.genRandNum(10, 1); i++) {
v = new Villager(genSettlerAge());
System.out.println(v);
}
}
private int genSettlerAge() {
return Utility.genRandNum(Limits.START_VILLAGER_AGE_MAX.id, Limits.START_VILLAGER_AGE_MIN.id);
}
private static enum Limits {
START_VILLAGER_AGE_MAX(30), START_VILLAGER_AGE_MIN(20);
private final int id;
Limits(int id) {
this.id = id;
}
}
// TODO: Make Villager Class
// TODO: Make Building Class
// TODO: PRODUCT Class
}