1
2 /**
3 IMPORTANT !!!
4
5 DO NOT EDIT THIS FILE. IT IS GENERATED FROM approriate xml file in xmlresources/gbinfomessages BY
6 THE JavaClassesGenerator.xslt. MODIFY THESE FILES INSTEAD OF THIS ONE.
7
8 IMPORTANT END !!!
9 */
10 package
11 cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages;
12 import java.util.*;
13 import javax.vecmath.*;
14 import cz.cuni.amis.pogamut.base.communication.messages.*;
15 import cz.cuni.amis.pogamut.base.communication.worldview.*;
16 import cz.cuni.amis.pogamut.base.communication.worldview.event.*;
17 import cz.cuni.amis.pogamut.base.communication.worldview.object.*;
18 import cz.cuni.amis.pogamut.base.communication.translator.event.*;
19 import cz.cuni.amis.pogamut.base3d.worldview.object.*;
20 import cz.cuni.amis.pogamut.base3d.worldview.object.event.*;
21 import cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId;
22 import cz.cuni.amis.pogamut.udk.communication.messages.*;
23 import cz.cuni.amis.pogamut.udk.communication.worldview.objects.*;
24 import cz.cuni.amis.pogamut.udk.communication.translator.itemdescriptor.*;
25 import cz.cuni.amis.pogamut.udk.communication.messages.ItemType.Category;
26 import cz.cuni.amis.utils.exception.*;
27 import cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result;
28 import cz.cuni.amis.utils.SafeEquals;
29 import cz.cuni.amis.pogamut.multi.communication.worldview.object.*;
30
31
32 /**
33
34 Info batch message. Start with SNGP, ends with ENGP. Sent for
35 each INAV message at the beginning of the communication. Holds
36 information about NavPoint neighbours. This way the reachability
37 graph can be exported from UDK. You should interpret this as
38 a DIRECTED EDGE of the navpoint GRAPH that describes the the edge
39 from FromNavPoint to ToNavPoint.
40
41 Corresponding GameBots message is
42 INGP.
43
44 */
45
46 public class
47 NavPointNeighbourLink extends
48 InfoMessage
49 implements IWorldEvent, IWorldChangeEvent
50
51 {
52
53 /**
54 Creates new instance of command NavPointNeighbourLink.
55
56 Info batch message. Start with SNGP, ends with ENGP. Sent for
57 each INAV message at the beginning of the communication. Holds
58 information about NavPoint neighbours. This way the reachability
59 graph can be exported from UDK. You should interpret this as
60 a DIRECTED EDGE of the navpoint GRAPH that describes the the edge
61 from FromNavPoint to ToNavPoint.
62 Corresponding GameBots message for this command is
63 .
64 @param Id
65 Unique Id of the NavPoint the link is leading to (end of the link). Always identical to ToNavPoint.getStringId().
66
67 @param Flags
68 Holds information about the path from the NavPoint to its
69 neighbour that is represented by this message. TODO: see
70 reachspecs on UnrealWiki.
71
72 @param CollisionR
73 Maximum collision radius of the path between navigation
74 points. Bot bigger then this cannot use this path.
75
76 @param CollisionH
77 Maximum collision height of the path between navigation
78 points. Bot bigger then this cannot use this path.
79
80 @param TranslocZOffset
81 TODO: mystery - we haven't figure it out so far.
82 Can be:
83 a) z-coord of the translocator target
84 b) translocator z-force for the translocator shot
85
86 @param TranslocTargetTag
87 TODO: mystery - we haven't figure it out so far.
88 Can be: where you should appear when successfully translocated or where to aim at
89
90 @param OnlyTranslocator
91 Whether the translocator is the only way how to traverse this navigation edge.
92
93 @param ForceDoubleJump
94 Whether you need to double jump to get to the neighbour navpoint.
95
96 @param NeededJump
97 TODO: mystery how to interpret
98
99 @param NeverImpactJump
100 TODO: mystery how to interpret
101
102 @param NoLowGrav
103 TODO: mystery how to interpret
104
105 @param CalculatedGravityZ
106 TODO: mystery how to interpret
107
108 @param FromNavPoint
109 Start of the link (edge), where the link originates.
110
111 @param ToNavPoint
112 End of the link (edge), where the link ends.
113
114 */
115 public NavPointNeighbourLink(
116 UnrealId Id, int Flags, int CollisionR, int CollisionH, double TranslocZOffset, String TranslocTargetTag, boolean OnlyTranslocator, boolean ForceDoubleJump, Vector3d NeededJump, boolean NeverImpactJump, boolean NoLowGrav, double CalculatedGravityZ, NavPoint FromNavPoint, NavPoint ToNavPoint) {
117
118 this.Id = Id;
119
120 this.Flags = Flags;
121
122 this.CollisionR = CollisionR;
123
124 this.CollisionH = CollisionH;
125
126 this.TranslocZOffset = TranslocZOffset;
127
128 this.TranslocTargetTag = TranslocTargetTag;
129
130 this.OnlyTranslocator = OnlyTranslocator;
131
132 this.ForceDoubleJump = ForceDoubleJump;
133
134 this.NeededJump = NeededJump;
135
136 this.NeverImpactJump = NeverImpactJump;
137
138 this.NoLowGrav = NoLowGrav;
139
140 this.CalculatedGravityZ = CalculatedGravityZ;
141
142 this.FromNavPoint = FromNavPoint;
143
144 this.ToNavPoint = ToNavPoint;
145
146 }
147
148
149 /** Example how the message looks like - used during parser tests. */
150 public static final String PROTOTYPE =
151 "INGP {Id unreal_id} {Flags 0} {CollisionR 0} {CollisionH 0} {TranslocZOffset 0} {TranslocTargetTag text} {OnlyTranslocator False} {ForceDoubleJump False} {NeededJump 0,0,0} {NeverImpactJump False} {NoLowGrav False} {CalculatedGravityZ 0}";
152
153
154 /////// Properties BEGIN
155
156 /**
157
158 Unique Id of the NavPoint the link is leading to (end of the link). Always identical to ToNavPoint.getStringId().
159 */
160 protected
161 UnrealId Id =
162 null;
163
164
165 /**
166
167 Unique Id of the NavPoint the link is leading to (end of the link). Always identical to ToNavPoint.getStringId().
168 */
169 public
170 UnrealId getId() {
171 return
172 Id;
173 }
174
175
176
177 /**
178
179 Holds information about the path from the NavPoint to its
180 neighbour that is represented by this message. TODO: see
181 reachspecs on UnrealWiki.
182 */
183 protected
184 int Flags =
185 0;
186
187
188 /**
189
190 Holds information about the path from the NavPoint to its
191 neighbour that is represented by this message. TODO: see
192 reachspecs on UnrealWiki.
193 */
194 public
195 int getFlags() {
196 return
197 Flags;
198 }
199
200
201
202 /**
203
204 Maximum collision radius of the path between navigation
205 points. Bot bigger then this cannot use this path.
206 */
207 protected
208 int CollisionR =
209 0;
210
211
212 /**
213
214 Maximum collision radius of the path between navigation
215 points. Bot bigger then this cannot use this path.
216 */
217 public
218 int getCollisionR() {
219 return
220 CollisionR;
221 }
222
223
224
225 /**
226
227 Maximum collision height of the path between navigation
228 points. Bot bigger then this cannot use this path.
229 */
230 protected
231 int CollisionH =
232 0;
233
234
235 /**
236
237 Maximum collision height of the path between navigation
238 points. Bot bigger then this cannot use this path.
239 */
240 public
241 int getCollisionH() {
242 return
243 CollisionH;
244 }
245
246
247
248 /**
249
250 TODO: mystery - we haven't figure it out so far.
251 Can be:
252 a) z-coord of the translocator target
253 b) translocator z-force for the translocator shot
254 */
255 protected
256 double TranslocZOffset =
257 0;
258
259
260 /**
261
262 TODO: mystery - we haven't figure it out so far.
263 Can be:
264 a) z-coord of the translocator target
265 b) translocator z-force for the translocator shot
266 */
267 public
268 double getTranslocZOffset() {
269 return
270 TranslocZOffset;
271 }
272
273
274
275 /**
276
277 TODO: mystery - we haven't figure it out so far.
278 Can be: where you should appear when successfully translocated or where to aim at
279 */
280 protected
281 String TranslocTargetTag =
282 null;
283
284
285 /**
286
287 TODO: mystery - we haven't figure it out so far.
288 Can be: where you should appear when successfully translocated or where to aim at
289 */
290 public
291 String getTranslocTargetTag() {
292 return
293 TranslocTargetTag;
294 }
295
296
297
298 /**
299
300 Whether the translocator is the only way how to traverse this navigation edge.
301 */
302 protected
303 boolean OnlyTranslocator =
304 false;
305
306
307 /**
308
309 Whether the translocator is the only way how to traverse this navigation edge.
310 */
311 public
312 boolean isOnlyTranslocator() {
313 return
314 OnlyTranslocator;
315 }
316
317
318
319 /**
320
321 Whether you need to double jump to get to the neighbour navpoint.
322 */
323 protected
324 boolean ForceDoubleJump =
325 false;
326
327
328 /**
329
330 Whether you need to double jump to get to the neighbour navpoint.
331 */
332 public
333 boolean isForceDoubleJump() {
334 return
335 ForceDoubleJump;
336 }
337
338
339
340 /**
341
342 TODO: mystery how to interpret
343 */
344 protected
345 Vector3d NeededJump =
346 null;
347
348
349 /**
350
351 TODO: mystery how to interpret
352 */
353 public
354 Vector3d getNeededJump() {
355 return
356 NeededJump;
357 }
358
359
360
361 /**
362
363 TODO: mystery how to interpret
364 */
365 protected
366 boolean NeverImpactJump =
367 false;
368
369
370 /**
371
372 TODO: mystery how to interpret
373 */
374 public
375 boolean isNeverImpactJump() {
376 return
377 NeverImpactJump;
378 }
379
380
381
382 /**
383
384 TODO: mystery how to interpret
385 */
386 protected
387 boolean NoLowGrav =
388 false;
389
390
391 /**
392
393 TODO: mystery how to interpret
394 */
395 public
396 boolean isNoLowGrav() {
397 return
398 NoLowGrav;
399 }
400
401
402
403 /**
404
405 TODO: mystery how to interpret
406 */
407 protected
408 double CalculatedGravityZ =
409 0;
410
411
412 /**
413
414 TODO: mystery how to interpret
415 */
416 public
417 double getCalculatedGravityZ() {
418 return
419 CalculatedGravityZ;
420 }
421
422
423
424 /**
425
426 Start of the link (edge), where the link originates.
427 */
428 protected
429 NavPoint FromNavPoint =
430 null;
431
432
433 /**
434
435 Start of the link (edge), where the link originates.
436 */
437 public
438 NavPoint getFromNavPoint() {
439 return
440 FromNavPoint;
441 }
442
443
444
445 /**
446
447 End of the link (edge), where the link ends.
448 */
449 protected
450 NavPoint ToNavPoint =
451 null;
452
453
454 /**
455
456 End of the link (edge), where the link ends.
457 */
458 public
459 NavPoint getToNavPoint() {
460 return
461 ToNavPoint;
462 }
463
464
465
466 /////// Properties END
467
468 /////// Extra Java code BEGIN
469
470 /////// Additional code from xslt BEGIN
471
472 public long getSimTime() {
473 // NOT IMPLEMENTED FOR UDK
474 return 0;
475 }
476
477
478
479 /////// Additional code from xslt END
480
481 /////// Extra Java from XML BEGIN
482
483 /**
484 * Use to fill missing fields of the Item when creating MapObtained event before
485 * INIT command is requested.
486 */
487 public NavPointNeighbourLink(
488 NavPointNeighbourLink orig,
489 NavPoint from,
490 NavPoint to
491 ) {
492 this(orig);
493 this.FromNavPoint = from;
494 this.ToNavPoint = to;
495 }
496
497 /////// Extra Java from XML END
498
499 /////// Extra Java code END
500
501
502
503 /**
504 * Cloning constructor.
505 */
506 public NavPointNeighbourLink(NavPointNeighbourLink original) {
507
508 this.Id=original.Id;
509
510 this.Flags=original.Flags;
511
512 this.CollisionR=original.CollisionR;
513
514 this.CollisionH=original.CollisionH;
515
516 this.TranslocZOffset=original.TranslocZOffset;
517
518 this.TranslocTargetTag=original.TranslocTargetTag;
519
520 this.OnlyTranslocator=original.OnlyTranslocator;
521
522 this.ForceDoubleJump=original.ForceDoubleJump;
523
524 this.NeededJump=original.NeededJump;
525
526 this.NeverImpactJump=original.NeverImpactJump;
527
528 this.NoLowGrav=original.NoLowGrav;
529
530 this.CalculatedGravityZ=original.CalculatedGravityZ;
531
532 this.FromNavPoint=original.FromNavPoint;
533
534 this.ToNavPoint=original.ToNavPoint;
535
536 }
537
538
539 /**
540 * Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
541 */
542 public NavPointNeighbourLink() {
543 }
544
545
546
547 public String toString() {
548 return
549
550 super.toString() + " | " +
551
552 "Id = " +
553 String.valueOf(Id) + " | " +
554
555 "Flags = " +
556 String.valueOf(Flags) + " | " +
557
558 "CollisionR = " +
559 String.valueOf(CollisionR) + " | " +
560
561 "CollisionH = " +
562 String.valueOf(CollisionH) + " | " +
563
564 "TranslocZOffset = " +
565 String.valueOf(TranslocZOffset) + " | " +
566
567 "TranslocTargetTag = " +
568 String.valueOf(TranslocTargetTag) + " | " +
569
570 "OnlyTranslocator = " +
571 String.valueOf(OnlyTranslocator) + " | " +
572
573 "ForceDoubleJump = " +
574 String.valueOf(ForceDoubleJump) + " | " +
575
576 "NeededJump = " +
577 String.valueOf(NeededJump) + " | " +
578
579 "NeverImpactJump = " +
580 String.valueOf(NeverImpactJump) + " | " +
581
582 "NoLowGrav = " +
583 String.valueOf(NoLowGrav) + " | " +
584
585 "CalculatedGravityZ = " +
586 String.valueOf(CalculatedGravityZ) + " | " +
587 "";
588
589 }
590
591 public String toHtmlString() {
592 return super.toString() +
593
594 "<b>Id</b> : " +
595 String.valueOf(Id) +
596 " <br/> " +
597
598 "<b>Flags</b> : " +
599 String.valueOf(Flags) +
600 " <br/> " +
601
602 "<b>CollisionR</b> : " +
603 String.valueOf(CollisionR) +
604 " <br/> " +
605
606 "<b>CollisionH</b> : " +
607 String.valueOf(CollisionH) +
608 " <br/> " +
609
610 "<b>TranslocZOffset</b> : " +
611 String.valueOf(TranslocZOffset) +
612 " <br/> " +
613
614 "<b>TranslocTargetTag</b> : " +
615 String.valueOf(TranslocTargetTag) +
616 " <br/> " +
617
618 "<b>OnlyTranslocator</b> : " +
619 String.valueOf(OnlyTranslocator) +
620 " <br/> " +
621
622 "<b>ForceDoubleJump</b> : " +
623 String.valueOf(ForceDoubleJump) +
624 " <br/> " +
625
626 "<b>NeededJump</b> : " +
627 String.valueOf(NeededJump) +
628 " <br/> " +
629
630 "<b>NeverImpactJump</b> : " +
631 String.valueOf(NeverImpactJump) +
632 " <br/> " +
633
634 "<b>NoLowGrav</b> : " +
635 String.valueOf(NoLowGrav) +
636 " <br/> " +
637
638 "<b>CalculatedGravityZ</b> : " +
639 String.valueOf(CalculatedGravityZ) +
640 " <br/> " +
641
642 "<b>FromNavPoint</b> : " +
643 String.valueOf(FromNavPoint) +
644 " <br/> " +
645
646 "<b>ToNavPoint</b> : " +
647 String.valueOf(ToNavPoint) +
648 " <br/> " +
649 "";
650 }
651
652
653
654 }
655
656