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 public class TraceResponse
28 extends InfoMessage
29 implements IWorldEvent, IWorldChangeEvent
30
31 {
32
33
34 public static final String PROTOTYPE =
35 "TRC {Id text} {From 0,0,0} {To 0,0,0} {Result False} {HitNormal 0,0,0} {HitLocation 0,0,0} {HitID unreal_id} {TraceActors False} ";
36
37
38
39
40
41
42 public TraceResponse()
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110 public TraceResponse(
111 String Id, Location From, Location To, boolean Result, Vector3d HitNormal, Vector3d HitLocation, UnrealId HitID, boolean TraceActors
112 ) {
113
114 this.Id = Id;
115
116 this.From = From;
117
118 this.To = To;
119
120 this.Result = Result;
121
122 this.HitNormal = HitNormal;
123
124 this.HitLocation = HitLocation;
125
126 this.HitID = HitID;
127
128 this.TraceActors = TraceActors;
129
130 }
131
132
133
134
135
136
137 public TraceResponse(TraceResponse original) {
138
139 this.Id = original.getId()
140 ;
141
142 this.From = original.getFrom()
143 ;
144
145 this.To = original.getTo()
146 ;
147
148 this.Result = original.isResult()
149 ;
150
151 this.HitNormal = original.getHitNormal()
152 ;
153
154 this.HitLocation = original.getHitLocation()
155 ;
156
157 this.HitID = original.getHitID()
158 ;
159
160 this.TraceActors = original.isTraceActors()
161 ;
162
163 this.SimTime = original.getSimTime();
164 }
165
166
167 protected long SimTime;
168
169
170
171
172 @Override
173 public long getSimTime() {
174 return SimTime;
175 }
176
177
178
179
180 protected void setSimTime(long SimTime) {
181 this.SimTime = SimTime;
182 }
183
184
185
186
187
188
189
190
191 protected
192 String Id =
193 null;
194
195
196
197
198
199
200
201 public String getId()
202 {
203 return Id;
204 }
205
206
207
208
209
210
211
212 protected
213 Location From =
214 null;
215
216
217
218
219
220
221 public Location getFrom()
222 {
223 return From;
224 }
225
226
227
228
229
230
231
232 protected
233 Location To =
234 null;
235
236
237
238
239
240
241 public Location getTo()
242 {
243 return To;
244 }
245
246
247
248
249
250
251
252 protected
253 boolean Result =
254 false;
255
256
257
258
259
260
261 public boolean isResult()
262 {
263 return Result;
264 }
265
266
267
268
269
270
271
272 protected
273 Vector3d HitNormal =
274 null;
275
276
277
278
279
280
281 public Vector3d getHitNormal()
282 {
283 return HitNormal;
284 }
285
286
287
288
289
290 protected
291 Vector3d HitLocation =
292 null;
293
294
295
296
297 public Vector3d getHitLocation()
298 {
299 return HitLocation;
300 }
301
302
303
304
305
306
307
308
309 protected
310 UnrealId HitID =
311 null;
312
313
314
315
316
317
318
319 public UnrealId getHitID()
320 {
321 return HitID;
322 }
323
324
325
326
327
328
329
330
331 protected
332 boolean TraceActors =
333 false;
334
335
336
337
338
339
340
341 public boolean isTraceActors()
342 {
343 return TraceActors;
344 }
345
346
347 public String toString() {
348 return
349 super.toString() + "[" +
350
351 "Id = " + String.valueOf(getId()
352 ) + " | " +
353
354 "From = " + String.valueOf(getFrom()
355 ) + " | " +
356
357 "To = " + String.valueOf(getTo()
358 ) + " | " +
359
360 "Result = " + String.valueOf(isResult()
361 ) + " | " +
362
363 "HitNormal = " + String.valueOf(getHitNormal()
364 ) + " | " +
365
366 "HitLocation = " + String.valueOf(getHitLocation()
367 ) + " | " +
368
369 "HitID = " + String.valueOf(getHitID()
370 ) + " | " +
371
372 "TraceActors = " + String.valueOf(isTraceActors()
373 ) + " | " +
374
375 "]";
376 }
377
378
379 public String toHtmlString() {
380 return super.toString() + "[<br/>" +
381
382 "<b>Id</b> = " + String.valueOf(getId()
383 ) + " <br/> " +
384
385 "<b>From</b> = " + String.valueOf(getFrom()
386 ) + " <br/> " +
387
388 "<b>To</b> = " + String.valueOf(getTo()
389 ) + " <br/> " +
390
391 "<b>Result</b> = " + String.valueOf(isResult()
392 ) + " <br/> " +
393
394 "<b>HitNormal</b> = " + String.valueOf(getHitNormal()
395 ) + " <br/> " +
396
397 "<b>HitLocation</b> = " + String.valueOf(getHitLocation()
398 ) + " <br/> " +
399
400 "<b>HitID</b> = " + String.valueOf(getHitID()
401 ) + " <br/> " +
402
403 "<b>TraceActors</b> = " + String.valueOf(isTraceActors()
404 ) + " <br/> " +
405
406 "<br/>]";
407 }
408
409 public String toJsonLiteral() {
410 return "TraceResponse(null, "
411
412 + ")";
413 }
414
415
416
417
418
419
420
421
422
423
424 }
425