1 package cz.cuni.amis.pogamut.ut2004.agent.module.sensor;
2
3 import com.thoughtworks.xstream.annotations.XStreamAlias;
4 import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
5
6 import cz.cuni.amis.pogamut.base3d.worldview.object.Location;
7 import cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId;
8 import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.NavPointNeighbourLink;
9
10 @XStreamAlias("Link")
11 public class NavPointLinkExport {
12
13 public NavPointLinkExport() {
14 }
15
16 public NavPointLinkExport(NavPointNeighbourLink link) {
17
18 if (link.getId() != null) this.Id = link.getId().getStringId();
19
20 this.Flags = link.getFlags();
21
22 this.CollisionR = link.getCollisionR();
23
24 this.CollisionH = link.getCollisionH();
25
26 this.TranslocZOffset = link.getTranslocZOffset();
27
28 this.TranslocTargetTag = link.getTranslocTargetTag();
29
30 this.OnlyTranslocator = link.isOnlyTranslocator();
31
32 this.ForceDoubleJump = link.isForceDoubleJump();
33
34 if (link.getNeededJump() != null) this.NeededJump = new Location(link.getNeededJump()).toString();
35
36 this.NeverImpactJump = link.isNeverImpactJump();
37
38 this.NoLowGrav = link.isNoLowGrav();
39
40 this.CalculatedGravityZ = link.getCalculatedGravityZ();
41
42 if (link.getFromNavPoint() != null && link.getFromNavPoint().getId() != null) this.FromNavPoint = link.getFromNavPoint().getId().getStringId();
43
44 if (link.getToNavPoint() != null && link.getToNavPoint().getId() != null) this.ToNavPoint = link.getToNavPoint().getId().getStringId();
45
46 }
47
48 @XStreamAsAttribute
49 public String Id;
50
51 @XStreamAsAttribute
52 public Integer Flags;
53
54 @XStreamAsAttribute
55 public Integer CollisionR;
56
57 @XStreamAsAttribute
58 public Integer CollisionH;
59
60 @XStreamAsAttribute
61 public Double TranslocZOffset;
62
63 @XStreamAsAttribute
64 public String TranslocTargetTag;
65
66 @XStreamAsAttribute
67 public Boolean OnlyTranslocator;
68
69 @XStreamAsAttribute
70 public Boolean ForceDoubleJump;
71
72 @XStreamAsAttribute
73 public String NeededJump;
74
75 @XStreamAsAttribute
76 public Boolean NeverImpactJump;
77
78 @XStreamAsAttribute
79 public Boolean NoLowGrav;
80
81 @XStreamAsAttribute
82 public Double CalculatedGravityZ;
83
84 @XStreamAsAttribute
85 public String FromNavPoint;
86
87 @XStreamAsAttribute
88 public String ToNavPoint;
89
90 private transient UnrealId unrealId;
91
92 public UnrealId getUnrealId() {
93 if (Id == null) return null;
94 if (unrealId == null) unrealId = UnrealId.get(Id);
95 return unrealId;
96 }
97
98 }