1 package cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages;
2
3
4 import java.util.*;import javax.vecmath.*;import cz.cuni.amis.pogamut.base.communication.messages.*;import cz.cuni.amis.pogamut.base.communication.worldview.*;import cz.cuni.amis.pogamut.base.communication.worldview.event.*;import cz.cuni.amis.pogamut.base.communication.worldview.object.*;import cz.cuni.amis.pogamut.multi.communication.worldview.object.*;import cz.cuni.amis.pogamut.base.communication.translator.event.*;import cz.cuni.amis.pogamut.multi.communication.translator.event.*;import cz.cuni.amis.pogamut.base3d.worldview.object.*;import cz.cuni.amis.pogamut.base3d.worldview.object.event.*;import cz.cuni.amis.pogamut.ut2004.communication.messages.*;import cz.cuni.amis.pogamut.ut2004.communication.worldview.objects.*;import cz.cuni.amis.pogamut.ut2004multi.communication.worldview.objects.*;import cz.cuni.amis.pogamut.ut2004.communication.translator.itemdescriptor.*;import cz.cuni.amis.pogamut.ut2004.communication.messages.ItemType.Category;import cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId;import cz.cuni.amis.utils.exception.*;import cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result;import cz.cuni.amis.utils.SafeEquals;import cz.cuni.amis.pogamut.base.agent.*;import cz.cuni.amis.pogamut.multi.agent.*;import cz.cuni.amis.pogamut.multi.communication.worldview.property.*;import cz.cuni.amis.pogamut.ut2004multi.communication.worldview.property.*;import cz.cuni.amis.utils.token.*;import cz.cuni.amis.utils.*;
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 public class WallCollision
30 extends InfoMessage
31 implements IWorldEvent, IWorldChangeEvent
32
33 {
34
35
36 public static final String PROTOTYPE =
37 "WAL {Id text} {Normal 0,0,0} {Location 0,0,0} ";
38
39
40
41
42
43
44 public WallCollision()
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 public WallCollision(
84 String Id, Vector3d Normal, Location Location
85 ) {
86
87 this.Id = Id;
88
89 this.Normal = Normal;
90
91 this.Location = Location;
92
93 }
94
95
96
97
98
99
100 public WallCollision(WallCollision original) {
101
102 this.Id = original.getId()
103 ;
104
105 this.Normal = original.getNormal()
106 ;
107
108 this.Location = original.getLocation()
109 ;
110
111 this.SimTime = original.getSimTime();
112 }
113
114
115 protected long SimTime;
116
117
118
119
120 @Override
121 public long getSimTime() {
122 return SimTime;
123 }
124
125
126
127
128 protected void setSimTime(long SimTime) {
129 this.SimTime = SimTime;
130 }
131
132
133
134
135
136
137
138 protected
139 String Id =
140 null;
141
142
143
144
145
146
147 public String getId()
148 {
149 return Id;
150 }
151
152
153
154
155
156
157
158 protected
159 Vector3d Normal =
160 null;
161
162
163
164
165
166
167 public Vector3d getNormal()
168 {
169 return Normal;
170 }
171
172
173
174
175
176
177
178 protected
179 Location Location =
180 null;
181
182
183
184
185
186
187 public Location getLocation()
188 {
189 return Location;
190 }
191
192
193 public String toString() {
194 return
195 super.toString() + "[" +
196
197 "Id = " + String.valueOf(getId()
198 ) + " | " +
199
200 "Normal = " + String.valueOf(getNormal()
201 ) + " | " +
202
203 "Location = " + String.valueOf(getLocation()
204 ) + " | " +
205
206 "]";
207 }
208
209
210 public String toHtmlString() {
211 return super.toString() + "[<br/>" +
212
213 "<b>Id</b> = " + String.valueOf(getId()
214 ) + " <br/> " +
215
216 "<b>Normal</b> = " + String.valueOf(getNormal()
217 ) + " <br/> " +
218
219 "<b>Location</b> = " + String.valueOf(getLocation()
220 ) + " <br/> " +
221
222 "<br/>]";
223 }
224
225 public String toJsonLiteral() {
226 return "wallcollision( "
227 +
228 (getId()
229 == null ? "null" :
230 "\"" + getId()
231 + "\""
232 )
233 + ", " +
234 (getNormal()
235 == null ? "null" :
236 "[" + getNormal()
237 .getX() + ", " + getNormal()
238 .getY() + ", " + getNormal()
239 .getZ() + "]"
240 )
241 + ", " +
242 (getLocation()
243 == null ? "null" :
244 "[" + getLocation()
245 .getX() + ", " + getLocation()
246 .getY() + ", " + getLocation()
247 .getZ() + "]"
248 )
249
250 + ")";
251 }
252
253
254
255
256
257
258
259
260
261
262 }
263