1
2
3
4
5
6
7
8
9
10 package
11 cz.cuni.amis.pogamut.udk.communication.messages.gbcommands;
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 import cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages.ConfigChange;
31
32
33
34
35
36
37
38
39
40
41
42
43
44 public class
45 Configuration extends
46 CommandMessage
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
111 public Configuration(
112 UnrealId Id, boolean AutoTrace, boolean ManualSpawn, String Name, String Action, double SpeedMultiplier, Rotation RotationRate, boolean Invulnerable, double VisionTime, boolean ShowDebug, boolean ShowFocalPoint, boolean DrawTraceLines, boolean SynchronousOff, boolean AutoPickupOff) {
113
114 this.Id = Id;
115
116 this.AutoTrace = AutoTrace;
117
118 this.ManualSpawn = ManualSpawn;
119
120 this.Name = Name;
121
122 this.Action = Action;
123
124 this.SpeedMultiplier = SpeedMultiplier;
125
126 this.RotationRate = RotationRate;
127
128 this.Invulnerable = Invulnerable;
129
130 this.VisionTime = VisionTime;
131
132 this.ShowDebug = ShowDebug;
133
134 this.ShowFocalPoint = ShowFocalPoint;
135
136 this.DrawTraceLines = DrawTraceLines;
137
138 this.SynchronousOff = SynchronousOff;
139
140 this.AutoPickupOff = AutoPickupOff;
141
142 }
143
144
145
146
147
148
149
150
151
152
153
154
155 public Configuration() {
156 }
157
158
159
160
161
162
163
164
165
166 protected
167 UnrealId Id =
168 null;
169
170
171
172
173
174
175
176 public
177 UnrealId getId() {
178 return
179 Id;
180 }
181
182
183
184
185
186
187
188
189 public Configuration setId(UnrealId Id) {
190 this.Id = Id;
191 return this;
192 }
193
194
195
196
197
198 protected
199 boolean AutoTrace =
200 false;
201
202
203
204
205
206
207 public
208 boolean isAutoTrace() {
209 return
210 AutoTrace;
211 }
212
213
214
215
216
217
218
219 public Configuration setAutoTrace(boolean AutoTrace) {
220 this.AutoTrace = AutoTrace;
221 return this;
222 }
223
224
225
226
227
228
229
230 protected
231 boolean ManualSpawn =
232 false;
233
234
235
236
237
238
239
240
241 public
242 boolean isManualSpawn() {
243 return
244 ManualSpawn;
245 }
246
247
248
249
250
251
252
253
254
255 public Configuration setManualSpawn(boolean ManualSpawn) {
256 this.ManualSpawn = ManualSpawn;
257 return this;
258 }
259
260
261
262
263
264 protected
265 String Name =
266 null;
267
268
269
270
271
272
273 public
274 String getName() {
275 return
276 Name;
277 }
278
279
280
281
282
283
284
285 public Configuration setName(String Name) {
286 this.Name = Name;
287 return this;
288 }
289
290
291
292
293
294 protected
295 String Action =
296 null;
297
298
299
300
301
302
303 public
304 String getAction() {
305 return
306 Action;
307 }
308
309
310
311
312
313
314
315 public Configuration setAction(String Action) {
316 this.Action = Action;
317 return this;
318 }
319
320
321
322
323
324 protected
325 double SpeedMultiplier =
326 0;
327
328
329
330
331
332
333 public
334 double getSpeedMultiplier() {
335 return
336 SpeedMultiplier;
337 }
338
339
340
341
342
343
344
345 public Configuration setSpeedMultiplier(double SpeedMultiplier) {
346 this.SpeedMultiplier = SpeedMultiplier;
347 return this;
348 }
349
350
351
352
353
354 protected
355 Rotation RotationRate =
356 null;
357
358
359
360
361
362
363 public
364 Rotation getRotationRate() {
365 return
366 RotationRate;
367 }
368
369
370
371
372
373
374
375 public Configuration setRotationRate(Rotation RotationRate) {
376 this.RotationRate = RotationRate;
377 return this;
378 }
379
380
381
382
383
384
385
386 protected
387 boolean Invulnerable =
388 false;
389
390
391
392
393
394
395
396
397 public
398 boolean isInvulnerable() {
399 return
400 Invulnerable;
401 }
402
403
404
405
406
407
408
409
410
411 public Configuration setInvulnerable(boolean Invulnerable) {
412 this.Invulnerable = Invulnerable;
413 return this;
414 }
415
416
417
418
419
420
421 protected
422 double VisionTime =
423 0;
424
425
426
427
428
429
430
431 public
432 double getVisionTime() {
433 return
434 VisionTime;
435 }
436
437
438
439
440
441
442
443
444 public Configuration setVisionTime(double VisionTime) {
445 this.VisionTime = VisionTime;
446 return this;
447 }
448
449
450
451
452
453
454 protected
455 boolean ShowDebug =
456 false;
457
458
459
460
461
462
463
464 public
465 boolean isShowDebug() {
466 return
467 ShowDebug;
468 }
469
470
471
472
473
474
475
476
477 public Configuration setShowDebug(boolean ShowDebug) {
478 this.ShowDebug = ShowDebug;
479 return this;
480 }
481
482
483
484
485
486
487 protected
488 boolean ShowFocalPoint =
489 false;
490
491
492
493
494
495
496
497 public
498 boolean isShowFocalPoint() {
499 return
500 ShowFocalPoint;
501 }
502
503
504
505
506
507
508
509
510 public Configuration setShowFocalPoint(boolean ShowFocalPoint) {
511 this.ShowFocalPoint = ShowFocalPoint;
512 return this;
513 }
514
515
516
517
518
519
520 protected
521 boolean DrawTraceLines =
522 false;
523
524
525
526
527
528
529
530 public
531 boolean isDrawTraceLines() {
532 return
533 DrawTraceLines;
534 }
535
536
537
538
539
540
541
542
543 public Configuration setDrawTraceLines(boolean DrawTraceLines) {
544 this.DrawTraceLines = DrawTraceLines;
545 return this;
546 }
547
548
549
550
551
552
553 protected
554 boolean SynchronousOff =
555 false;
556
557
558
559
560
561
562
563 public
564 boolean isSynchronousOff() {
565 return
566 SynchronousOff;
567 }
568
569
570
571
572
573
574
575
576 public Configuration setSynchronousOff(boolean SynchronousOff) {
577 this.SynchronousOff = SynchronousOff;
578 return this;
579 }
580
581
582
583
584
585 protected
586 boolean AutoPickupOff =
587 false;
588
589
590
591
592
593
594 public
595 boolean isAutoPickupOff() {
596 return
597 AutoPickupOff;
598 }
599
600
601
602
603
604
605
606 public Configuration setAutoPickupOff(boolean AutoPickupOff) {
607 this.AutoPickupOff = AutoPickupOff;
608 return this;
609 }
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627 public void copy(ConfigChange confCh) {
628 setAutoPickupOff(confCh.isAutoPickupOff());
629 setAutoTrace(confCh.isAutoTrace());
630 setDrawTraceLines(confCh.isDrawTraceLines());
631 setInvulnerable(confCh.isInvulnerable());
632 setManualSpawn(confCh.isManualSpawn());
633 setShowDebug(confCh.isShowDebug());
634 setShowFocalPoint(confCh.isShowFocalPoint());
635 setSynchronousOff(confCh.isSynchronousOff());
636 }
637
638
639
640
641
642
643
644
645
646
647 public Configuration(Configuration original) {
648
649 this.Id=original.Id;
650
651 this.AutoTrace=original.AutoTrace;
652
653 this.ManualSpawn=original.ManualSpawn;
654
655 this.Name=original.Name;
656
657 this.Action=original.Action;
658
659 this.SpeedMultiplier=original.SpeedMultiplier;
660
661 this.RotationRate=original.RotationRate;
662
663 this.Invulnerable=original.Invulnerable;
664
665 this.VisionTime=original.VisionTime;
666
667 this.ShowDebug=original.ShowDebug;
668
669 this.ShowFocalPoint=original.ShowFocalPoint;
670
671 this.DrawTraceLines=original.DrawTraceLines;
672
673 this.SynchronousOff=original.SynchronousOff;
674
675 this.AutoPickupOff=original.AutoPickupOff;
676
677 }
678
679
680
681
682 public String toString() {
683 return
684
685 toMessage();
686
687 }
688
689 public String toHtmlString() {
690 return super.toString() +
691
692 "<b>Id</b> : " +
693 String.valueOf(Id) +
694 " <br/> " +
695
696 "<b>AutoTrace</b> : " +
697 String.valueOf(AutoTrace) +
698 " <br/> " +
699
700 "<b>ManualSpawn</b> : " +
701 String.valueOf(ManualSpawn) +
702 " <br/> " +
703
704 "<b>Name</b> : " +
705 String.valueOf(Name) +
706 " <br/> " +
707
708 "<b>Action</b> : " +
709 String.valueOf(Action) +
710 " <br/> " +
711
712 "<b>SpeedMultiplier</b> : " +
713 String.valueOf(SpeedMultiplier) +
714 " <br/> " +
715
716 "<b>RotationRate</b> : " +
717 String.valueOf(RotationRate) +
718 " <br/> " +
719
720 "<b>Invulnerable</b> : " +
721 String.valueOf(Invulnerable) +
722 " <br/> " +
723
724 "<b>VisionTime</b> : " +
725 String.valueOf(VisionTime) +
726 " <br/> " +
727
728 "<b>ShowDebug</b> : " +
729 String.valueOf(ShowDebug) +
730 " <br/> " +
731
732 "<b>ShowFocalPoint</b> : " +
733 String.valueOf(ShowFocalPoint) +
734 " <br/> " +
735
736 "<b>DrawTraceLines</b> : " +
737 String.valueOf(DrawTraceLines) +
738 " <br/> " +
739
740 "<b>SynchronousOff</b> : " +
741 String.valueOf(SynchronousOff) +
742 " <br/> " +
743
744 "<b>AutoPickupOff</b> : " +
745 String.valueOf(AutoPickupOff) +
746 " <br/> " +
747 "";
748 }
749
750
751
752 public String toMessage() {
753 StringBuffer buf = new StringBuffer();
754 buf.append("CONF");
755
756 if (Id != null) {
757 buf.append(" {Id " + Id.getStringId() + "}");
758 }
759
760 buf.append(" {AutoTrace " + AutoTrace + "}");
761
762 buf.append(" {ManualSpawn " + ManualSpawn + "}");
763
764 if (Name != null) {
765 buf.append(" {Name " + Name + "}");
766 }
767
768 if (Action != null) {
769 buf.append(" {Action " + Action + "}");
770 }
771
772 buf.append(" {SpeedMultiplier " + SpeedMultiplier + "}");
773
774 if (RotationRate != null) {
775 buf.append(" {RotationRate " +
776 RotationRate.getPitch() + "," +
777 RotationRate.getYaw() + "," +
778 RotationRate.getRoll() + "}");
779 }
780
781 buf.append(" {Invulnerable " + Invulnerable + "}");
782
783 buf.append(" {VisionTime " + VisionTime + "}");
784
785 buf.append(" {ShowDebug " + ShowDebug + "}");
786
787 buf.append(" {ShowFocalPoint " + ShowFocalPoint + "}");
788
789 buf.append(" {DrawTraceLines " + DrawTraceLines + "}");
790
791 buf.append(" {SynchronousOff " + SynchronousOff + "}");
792
793 buf.append(" {AutoPickupOff " + AutoPickupOff + "}");
794
795 return buf.toString();
796 }
797
798 }
799
800