-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameChoices.java
More file actions
75 lines (61 loc) · 2.23 KB
/
GameChoices.java
File metadata and controls
75 lines (61 loc) · 2.23 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package game;
import java.util.ResourceBundle;
public class GameChoices {
private Storage Node45 = new Storage();
private Storage Node34 = new Storage();
private Storage Node70 = new Storage();
private Storage Node24 = new Storage();
private Storage Node38 = new Storage();
private Storage Node62 = new Storage();
private Storage Node80 = new Storage();
private Storage Node21 = new Storage();
private Storage Node27 = new Storage();
private Storage Node37 = new Storage();
private Storage Node41 = new Storage();
private Storage Node79 = new Storage();
private Storage Node82 = new Storage();
private Storage Node26 = new Storage();
private Storage Node28 = new Storage();
private Storage Node81 = new Storage();
private Storage Node83 = new Storage();
void initFromPropBundle() {
// so we're expecting a file in our CLASSPATH called
// PropertyBundleDemo.properties
ResourceBundle bundle = ResourceBundle.getBundle("GameChoices");
String names[] = {"Node45","Node34","Node70","Node24","Node38","Node62",
"Node80","Node21","Node27","Node37","Node41","Node79","Node82","Node26",
"Node28","Node81","Node83"};
Storage sArr[] = {Node45,Node34,Node70,Node24,Node38,Node62,
Node80,Node21,Node27,Node37,Node41,Node79,Node82,Node26,
Node28,Node81,Node83};
for(int i = 0;i<names.length;i++) {
if (bundle.containsKey(names[i])) {
sArr[i].story = bundle.getString(names[i]);
}
if (bundle.containsKey(names[i]+"L")) {
sArr[i].lText = bundle.getString(names[i]+"L");
}
if (bundle.containsKey(names[i]+"R")) {
sArr[i].rText = bundle.getString(names[i]+"R");
}
if (bundle.containsKey(names[i]+"T")) {
sArr[i].type = bundle.getString(names[i]+"T");
}
}
}
public Storage[] stringArr()
{
Storage[] stringArr = {Node45,Node34,Node70,Node24,Node38,Node62,
Node80,Node21,Node27,Node37,Node41,Node79,Node82,Node26,
Node28,Node81,Node83};
return stringArr;
}
}
class Storage {
public String story;
public String lText;
public String rText;
public String type;
public Storage() {
}
}