1
2
3
4
5
6
7
8
9
10
11
12 package cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands;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.*;
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 public class AddRay
33 extends CommandMessage
34 {
35
36
37
38 public static final String PROTOTYPE =
39 " {Id text} {Direction 0,0,0} {Length 0} {FastTrace False} {FloorCorrection False} {TraceActors False} ";
40
41
42
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 public AddRay(
87 String Id, Vector3d Direction, Integer Length, Boolean FastTrace, Boolean FloorCorrection, Boolean TraceActors
88 ) {
89
90 this.Id = Id;
91
92 this.Direction = Direction;
93
94 this.Length = Length;
95
96 this.FastTrace = FastTrace;
97
98 this.FloorCorrection = FloorCorrection;
99
100 this.TraceActors = TraceActors;
101
102 }
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127 public AddRay() {
128 }
129
130
131
132
133
134
135
136 public AddRay(AddRay original) {
137
138 this.Id = original.Id;
139
140 this.Direction = original.Direction;
141
142 this.Length = original.Length;
143
144 this.FastTrace = original.FastTrace;
145
146 this.FloorCorrection = original.FloorCorrection;
147
148 this.TraceActors = original.TraceActors;
149
150 }
151
152
153
154
155
156
157 protected
158 String Id =
159
160 null
161 ;
162
163
164
165
166
167
168
169
170 public String getId()
171
172 {
173 return
174 Id;
175 }
176
177
178
179
180
181
182
183
184
185 public AddRay
186 setId(String Id)
187
188 {
189 this.Id = Id;
190 return this;
191 }
192
193
194
195
196
197
198
199
200 protected
201 Vector3d Direction =
202
203 null
204 ;
205
206
207
208
209
210
211
212
213
214
215 public Vector3d getDirection()
216
217 {
218 return
219 Direction;
220 }
221
222
223
224
225
226
227
228
229
230
231
232 public AddRay
233 setDirection(Vector3d Direction)
234
235 {
236 this.Direction = Direction;
237 return this;
238 }
239
240
241
242
243
244
245 protected
246 Integer Length =
247
248 null
249 ;
250
251
252
253
254
255
256
257
258 public Integer getLength()
259
260 {
261 return
262 Length;
263 }
264
265
266
267
268
269
270
271
272
273 public AddRay
274 setLength(Integer Length)
275
276 {
277 this.Length = Length;
278 return this;
279 }
280
281
282
283
284
285
286
287
288 protected
289 Boolean FastTrace =
290
291 null
292 ;
293
294
295
296
297
298
299
300
301
302
303 public Boolean isFastTrace()
304
305 {
306 return
307 FastTrace;
308 }
309
310
311
312
313
314
315
316
317
318
319
320 public AddRay
321 setFastTrace(Boolean FastTrace)
322
323 {
324 this.FastTrace = FastTrace;
325 return this;
326 }
327
328
329
330
331
332
333 protected
334 Boolean FloorCorrection =
335
336 null
337 ;
338
339
340
341
342
343
344
345
346 public Boolean isFloorCorrection()
347
348 {
349 return
350 FloorCorrection;
351 }
352
353
354
355
356
357
358
359
360
361 public AddRay
362 setFloorCorrection(Boolean FloorCorrection)
363
364 {
365 this.FloorCorrection = FloorCorrection;
366 return this;
367 }
368
369
370
371
372
373
374
375 protected
376 Boolean TraceActors =
377
378 null
379 ;
380
381
382
383
384
385
386
387
388
389 public Boolean isTraceActors()
390
391 {
392 return
393 TraceActors;
394 }
395
396
397
398
399
400
401
402
403
404
405 public AddRay
406 setTraceActors(Boolean TraceActors)
407
408 {
409 this.TraceActors = TraceActors;
410 return this;
411 }
412
413 public String toString() {
414 return toMessage();
415 }
416
417 public String toHtmlString() {
418 return super.toString() + "[<br/>" +
419
420 "<b>Id</b> = " +
421 String.valueOf(getId()
422 ) +
423 " <br/> " +
424
425 "<b>Direction</b> = " +
426 String.valueOf(getDirection()
427 ) +
428 " <br/> " +
429
430 "<b>Length</b> = " +
431 String.valueOf(getLength()
432 ) +
433 " <br/> " +
434
435 "<b>FastTrace</b> = " +
436 String.valueOf(isFastTrace()
437 ) +
438 " <br/> " +
439
440 "<b>FloorCorrection</b> = " +
441 String.valueOf(isFloorCorrection()
442 ) +
443 " <br/> " +
444
445 "<b>TraceActors</b> = " +
446 String.valueOf(isTraceActors()
447 ) +
448 " <br/> " +
449
450 "<br/>]"
451 ;
452 }
453
454 public String toMessage() {
455 StringBuffer buf = new StringBuffer();
456 buf.append("ADDRAY");
457
458 if (Id != null) {
459 buf.append(" {Id " + Id + "}");
460 }
461
462 if (Direction != null) {
463 buf.append(" {Direction " +
464 Direction.getX() + "," +
465 Direction.getY() + "," +
466 Direction.getZ() + "}");
467 }
468
469 if (Length != null) {
470 buf.append(" {Length " + Length + "}");
471 }
472
473 if (FastTrace != null) {
474 buf.append(" {FastTrace " + FastTrace + "}");
475 }
476
477 if (FloorCorrection != null) {
478 buf.append(" {FloorCorrection " + FloorCorrection + "}");
479 }
480
481 if (TraceActors != null) {
482 buf.append(" {TraceActors " + TraceActors + "}");
483 }
484
485 return buf.toString();
486 }
487
488
489
490
491
492 }
493