-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTravelToAction.java
More file actions
60 lines (48 loc) · 2.12 KB
/
Copy pathTravelToAction.java
File metadata and controls
60 lines (48 loc) · 2.12 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
package actions;
import storyelements.Location;
import storyelements.StoryCharacter;
import java.util.List;
import storygenerator.WorldProperty;
import storygenerator.WorldProperty.PropertyKey;
/**
*
* @author etienne
*/
public class TravelToAction extends Action {
public TravelToAction(StoryCharacter pTraveller, Location pDestination, List<Location> pAllLocs) {
super();
//Text to be displayed when the action is performed in the story
aNarrativeForm = "The " + pTraveller + " travelled to the " + pDestination + ".";
//Facts that need to be TRUE to fire the action
//none
//Facts that need to be FALSE to fire the action
aPreFalse.add(new WorldProperty(pTraveller, PropertyKey.IS_AT_LOCATION, pDestination));
//Facts that BECOME TRUE as a result
aPostTrue.add(new WorldProperty(pTraveller, PropertyKey.IS_AT_LOCATION, pDestination));
//Facts that BECOME FALSE as a result
for (Location l : pAllLocs) {
if (!l.equals(pDestination)) {
aPostFalse.add(new WorldProperty(pTraveller, PropertyKey.IS_AT_LOCATION, l));
}
}
}
// public TravelToAction(StoryCharacter pTraveller, Location pFrom, Location pTo) {
// super();
//
// //Text to be displayed when the action is performed in the story
// aNarrativeForm = "The " + pTraveller + " travelled from the " + pFrom +
// " to the " + pTo + ".";
//
// //Facts that need to be TRUE to fire the action
// aPreTrue.add(new WorldProperty(pTraveller, PropertyKey.IS_AT_LOCATION, pFrom));
//
// //Facts that need to be FALSE to fire the action
// aPreFalse.add(new WorldProperty(pTraveller, PropertyKey.IS_AT_LOCATION, pTo));
//
// //Facts that BECOME TRUE as a result
// aPostTrue.add(new WorldProperty(pTraveller, PropertyKey.IS_AT_LOCATION, pTo));
//
// //Facts that BECOME FALSE as a result
// aPostFalse.add(new WorldProperty(pTraveller, PropertyKey.IS_AT_LOCATION, pFrom));
// }
}