-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathExit.java
More file actions
36 lines (30 loc) · 757 Bytes
/
Exit.java
File metadata and controls
36 lines (30 loc) · 757 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
public class Exit
{
private String name;
private int destinationID;
public Exit(JSONObject obj)
{
this.name = ((JSONStringVariable)obj.getVariableForName("name")).getValue();
this.destinationID = ((JSONNumberVariable)obj.getVariableForName("destinationID")).getValue();
}
public Exit(String name, int destinationID)
{
this.name = name;
this.destinationID = destinationID;
}
public JSONObject getJSONObject()
{
JSONObject theObj = new JSONObject();
theObj.addVariable(new JSONStringVariable("name", this.name));
theObj.addVariable(new JSONNumberVariable("destinationID", this.destinationID));
return theObj;
}
public String getName()
{
return name;
}
public int getDestinationID()
{
return destinationID;
}
}