-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdialog.java
72 lines (63 loc) · 1.53 KB
/
dialog.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
/**
* Write a description of class dialog here.
*
* @author Justin Nichol
* @version .01
*/
public class dialog
{
// instance variables - replace the example below with your own
private String npcString = "";
private String playerResponse = "";
int firstRes = 0;
int secondRes = 0;
int thirdRes = 0;
int fourthRes = 0;
int numRes = 0;
/**
* Constructor for objects of class dialog
*/
public dialog(String npc, String responses, int firstRes, int secondRes, int thirdRes, int fourthRes, int numRes)
{
this.npcString = npc;
this.playerResponse = responses;
this.firstRes = firstRes;
this.secondRes = secondRes;
this.thirdRes = thirdRes;
this.fourthRes = fourthRes;
this.numRes = numRes;
}
/**
* An example of a method - replace this comment with your own
*
* @param y a sample parameter for a method
* @return the sum of x and y
*/
public String npcDialog()
{
return npcString;
}
public String getPlayerOptions()
{
return playerResponse;
}
public int nextBranch(int answer)
{
if (answer == 1) {
return firstRes;
}
else if (answer == 2) {
return secondRes;
}
else if (answer == 3) {
return thirdRes;
}
else {
return fourthRes;
}
}
public int getNumResponses()
{
return numRes;
}
}