-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathDialogNode.java
103 lines (87 loc) · 2.62 KB
/
DialogNode.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
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import java.util.*;
public class DialogNode {
private final String blurb;
private final List<AbstractMap.SimpleEntry<String, DialogNode>> choices;
// Whether reaching this dialog node wins/loses the game; most nodes are null
private final Boolean wins;
// this is an item that will be given as a reward for hitting this particular dialogue
// in most cases, this will also be null
private final Item reward;
private List<Item> required;
public DialogNode (String blurb) {
this.blurb = blurb;
this.choices = null;
this.wins = null;
this.reward = null;
this.required = null;
}
public DialogNode (String blurb, Boolean wins) {
this.blurb = blurb;
this.choices = null;
this.wins = wins;
this.reward = null;
this.required = null;
}
public DialogNode (String blurb, Item reward) {
this.blurb = blurb;
this.choices = null;
this.wins = null;
this.reward = reward;
this.required = null;
}
public DialogNode (String blurb, List<Item> required) {
this.blurb = blurb;
this.choices = null;
this.wins = null;
this.reward = null;
this.required = required;
}
public DialogNode (String blurb, List<Item> required, Boolean wins) {
this.blurb = blurb;
this.choices = new ArrayList<>();
this.wins = wins;
this.reward = null;
this.required = required;
}
public DialogNode(String blurb, List<Item> required, Item reward) {
this.blurb = blurb;
this.choices = null;
this.wins = null;
this.reward = reward;
this.required = required;
}
public DialogNode (String blurb, Boolean wins, List<AbstractMap.SimpleEntry<String, DialogNode>> choices) {
this.blurb = blurb;
this.choices = choices;
this.wins = wins;
this.reward = null;
this.required = null;
}
public DialogNode (String blurb, Boolean wins, List<AbstractMap.SimpleEntry<String, DialogNode>> choices, List<Item> required) {
this.blurb = blurb;
this.choices = choices;
this.wins = wins;
this.required = required;
this.reward = null;
}
public DialogNode(String blurb, Boolean wins, List<AbstractMap.SimpleEntry<String, DialogNode>> choices, List<Item> required, Item reward) {
this.blurb = blurb;
this.choices = choices;
this.wins = wins;
this.required = required;
this.reward = reward;
}
public Boolean getWin() { return this.wins; }
public Item getReward() {
return this.reward;
}
public List<Item> getRequired () {
return required;
}
public List<AbstractMap.SimpleEntry<String, DialogNode>> getChoices () {
return choices;
}
public String getBlurb () {
return blurb;
}
}