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.*;import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.ConfigChange;
13
14
15
16
17
18
19
20
21
22 public class Configuration
23 extends CommandMessage
24 {
25
26
27
28 public static final String PROTOTYPE =
29 " {Id unreal_id} {AutoTrace False} {ManualSpawn False} {Name text} {Action text} {SpeedMultiplier 0} {RotationRate 0,0,0} {Invulnerable False} {VisionTime 0} {ShowDebug False} {ShowFocalPoint False} {DrawTraceLines False} {SynchronousOff False} {SyncNavPointsOff False} {AutoPickupOff False} ";
30
31
32
33
34
35
36
37
38
39
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
87
88
89
90
91
92
93
94
95
96
97
98 public Configuration(
99 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 SyncNavPointsOff, Boolean AutoPickupOff
100 ) {
101
102 this.Id = Id;
103
104 this.AutoTrace = AutoTrace;
105
106 this.ManualSpawn = ManualSpawn;
107
108 this.Name = Name;
109
110 this.Action = Action;
111
112 this.SpeedMultiplier = SpeedMultiplier;
113
114 this.RotationRate = RotationRate;
115
116 this.Invulnerable = Invulnerable;
117
118 this.VisionTime = VisionTime;
119
120 this.ShowDebug = ShowDebug;
121
122 this.ShowFocalPoint = ShowFocalPoint;
123
124 this.DrawTraceLines = DrawTraceLines;
125
126 this.SynchronousOff = SynchronousOff;
127
128 this.SyncNavPointsOff = SyncNavPointsOff;
129
130 this.AutoPickupOff = AutoPickupOff;
131
132 }
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147 public Configuration() {
148 }
149
150
151
152
153
154
155
156 public Configuration(Configuration original) {
157
158 this.Id = original.Id;
159
160 this.AutoTrace = original.AutoTrace;
161
162 this.ManualSpawn = original.ManualSpawn;
163
164 this.Name = original.Name;
165
166 this.Action = original.Action;
167
168 this.SpeedMultiplier = original.SpeedMultiplier;
169
170 this.RotationRate = original.RotationRate;
171
172 this.Invulnerable = original.Invulnerable;
173
174 this.VisionTime = original.VisionTime;
175
176 this.ShowDebug = original.ShowDebug;
177
178 this.ShowFocalPoint = original.ShowFocalPoint;
179
180 this.DrawTraceLines = original.DrawTraceLines;
181
182 this.SynchronousOff = original.SynchronousOff;
183
184 this.SyncNavPointsOff = original.SyncNavPointsOff;
185
186 this.AutoPickupOff = original.AutoPickupOff;
187
188 }
189
190
191
192
193
194
195
196 protected
197 UnrealId Id =
198
199 null
200 ;
201
202
203
204
205
206
207
208
209
210 public UnrealId getId()
211
212 {
213 return
214 Id;
215 }
216
217
218
219
220
221
222
223
224
225
226 public Configuration
227 setId(UnrealId Id)
228
229 {
230 this.Id = Id;
231 return this;
232 }
233
234
235
236
237
238
239 protected
240 Boolean AutoTrace =
241
242 null
243 ;
244
245
246
247
248
249
250
251
252 public Boolean isAutoTrace()
253
254 {
255 return
256 AutoTrace;
257 }
258
259
260
261
262
263
264
265
266
267 public Configuration
268 setAutoTrace(Boolean AutoTrace)
269
270 {
271 this.AutoTrace = AutoTrace;
272 return this;
273 }
274
275
276
277
278
279
280
281
282 protected
283 Boolean ManualSpawn =
284
285 null
286 ;
287
288
289
290
291
292
293
294
295
296
297 public Boolean isManualSpawn()
298
299 {
300 return
301 ManualSpawn;
302 }
303
304
305
306
307
308
309
310
311
312
313
314 public Configuration
315 setManualSpawn(Boolean ManualSpawn)
316
317 {
318 this.ManualSpawn = ManualSpawn;
319 return this;
320 }
321
322
323
324
325
326
327 protected
328 String Name =
329
330 null
331 ;
332
333
334
335
336
337
338
339
340 public String getName()
341
342 {
343 return
344 Name;
345 }
346
347
348
349
350
351
352
353
354
355 public Configuration
356 setName(String Name)
357
358 {
359 this.Name = Name;
360 return this;
361 }
362
363
364
365
366
367
368 protected
369 String Action =
370
371 null
372 ;
373
374
375
376
377
378
379
380
381 public String getAction()
382
383 {
384 return
385 Action;
386 }
387
388
389
390
391
392
393
394
395
396 public Configuration
397 setAction(String Action)
398
399 {
400 this.Action = Action;
401 return this;
402 }
403
404
405
406
407
408
409 protected
410 Double SpeedMultiplier =
411
412 null
413 ;
414
415
416
417
418
419
420
421
422 public Double getSpeedMultiplier()
423
424 {
425 return
426 SpeedMultiplier;
427 }
428
429
430
431
432
433
434
435
436
437 public Configuration
438 setSpeedMultiplier(Double SpeedMultiplier)
439
440 {
441 this.SpeedMultiplier = SpeedMultiplier;
442 return this;
443 }
444
445
446
447
448
449
450 protected
451 Rotation RotationRate =
452
453 null
454 ;
455
456
457
458
459
460
461
462
463 public Rotation getRotationRate()
464
465 {
466 return
467 RotationRate;
468 }
469
470
471
472
473
474
475
476
477
478 public Configuration
479 setRotationRate(Rotation RotationRate)
480
481 {
482 this.RotationRate = RotationRate;
483 return this;
484 }
485
486
487
488
489
490
491
492
493 protected
494 Boolean Invulnerable =
495
496 null
497 ;
498
499
500
501
502
503
504
505
506
507
508 public Boolean isInvulnerable()
509
510 {
511 return
512 Invulnerable;
513 }
514
515
516
517
518
519
520
521
522
523
524
525 public Configuration
526 setInvulnerable(Boolean Invulnerable)
527
528 {
529 this.Invulnerable = Invulnerable;
530 return this;
531 }
532
533
534
535
536
537
538
539 protected
540 Double VisionTime =
541
542 null
543 ;
544
545
546
547
548
549
550
551
552
553 public Double getVisionTime()
554
555 {
556 return
557 VisionTime;
558 }
559
560
561
562
563
564
565
566
567
568
569 public Configuration
570 setVisionTime(Double VisionTime)
571
572 {
573 this.VisionTime = VisionTime;
574 return this;
575 }
576
577
578
579
580
581
582
583 protected
584 Boolean ShowDebug =
585
586 null
587 ;
588
589
590
591
592
593
594
595
596
597 public Boolean isShowDebug()
598
599 {
600 return
601 ShowDebug;
602 }
603
604
605
606
607
608
609
610
611
612
613 public Configuration
614 setShowDebug(Boolean ShowDebug)
615
616 {
617 this.ShowDebug = ShowDebug;
618 return this;
619 }
620
621
622
623
624
625
626
627 protected
628 Boolean ShowFocalPoint =
629
630 null
631 ;
632
633
634
635
636
637
638
639
640
641 public Boolean isShowFocalPoint()
642
643 {
644 return
645 ShowFocalPoint;
646 }
647
648
649
650
651
652
653
654
655
656
657 public Configuration
658 setShowFocalPoint(Boolean ShowFocalPoint)
659
660 {
661 this.ShowFocalPoint = ShowFocalPoint;
662 return this;
663 }
664
665
666
667
668
669
670
671 protected
672 Boolean DrawTraceLines =
673
674 null
675 ;
676
677
678
679
680
681
682
683
684
685 public Boolean isDrawTraceLines()
686
687 {
688 return
689 DrawTraceLines;
690 }
691
692
693
694
695
696
697
698
699
700
701 public Configuration
702 setDrawTraceLines(Boolean DrawTraceLines)
703
704 {
705 this.DrawTraceLines = DrawTraceLines;
706 return this;
707 }
708
709
710
711
712
713
714
715 protected
716 Boolean SynchronousOff =
717
718 null
719 ;
720
721
722
723
724
725
726
727
728
729 public Boolean isSynchronousOff()
730
731 {
732 return
733 SynchronousOff;
734 }
735
736
737
738
739
740
741
742
743
744
745 public Configuration
746 setSynchronousOff(Boolean SynchronousOff)
747
748 {
749 this.SynchronousOff = SynchronousOff;
750 return this;
751 }
752
753
754
755
756
757
758 protected
759 Boolean SyncNavPointsOff =
760
761 null
762 ;
763
764
765
766
767
768
769
770
771 public Boolean isSyncNavPointsOff()
772
773 {
774 return
775 SyncNavPointsOff;
776 }
777
778
779
780
781
782
783
784
785
786 public Configuration
787 setSyncNavPointsOff(Boolean SyncNavPointsOff)
788
789 {
790 this.SyncNavPointsOff = SyncNavPointsOff;
791 return this;
792 }
793
794
795
796
797
798
799 protected
800 Boolean AutoPickupOff =
801
802 null
803 ;
804
805
806
807
808
809
810
811
812 public Boolean isAutoPickupOff()
813
814 {
815 return
816 AutoPickupOff;
817 }
818
819
820
821
822
823
824
825
826
827 public Configuration
828 setAutoPickupOff(Boolean AutoPickupOff)
829
830 {
831 this.AutoPickupOff = AutoPickupOff;
832 return this;
833 }
834
835 public String toString() {
836 return toMessage();
837 }
838
839 public String toHtmlString() {
840 return super.toString() + "[<br/>" +
841
842 "<b>Id</b> = " +
843 String.valueOf(getId()
844 ) +
845 " <br/> " +
846
847 "<b>AutoTrace</b> = " +
848 String.valueOf(isAutoTrace()
849 ) +
850 " <br/> " +
851
852 "<b>ManualSpawn</b> = " +
853 String.valueOf(isManualSpawn()
854 ) +
855 " <br/> " +
856
857 "<b>Name</b> = " +
858 String.valueOf(getName()
859 ) +
860 " <br/> " +
861
862 "<b>Action</b> = " +
863 String.valueOf(getAction()
864 ) +
865 " <br/> " +
866
867 "<b>SpeedMultiplier</b> = " +
868 String.valueOf(getSpeedMultiplier()
869 ) +
870 " <br/> " +
871
872 "<b>RotationRate</b> = " +
873 String.valueOf(getRotationRate()
874 ) +
875 " <br/> " +
876
877 "<b>Invulnerable</b> = " +
878 String.valueOf(isInvulnerable()
879 ) +
880 " <br/> " +
881
882 "<b>VisionTime</b> = " +
883 String.valueOf(getVisionTime()
884 ) +
885 " <br/> " +
886
887 "<b>ShowDebug</b> = " +
888 String.valueOf(isShowDebug()
889 ) +
890 " <br/> " +
891
892 "<b>ShowFocalPoint</b> = " +
893 String.valueOf(isShowFocalPoint()
894 ) +
895 " <br/> " +
896
897 "<b>DrawTraceLines</b> = " +
898 String.valueOf(isDrawTraceLines()
899 ) +
900 " <br/> " +
901
902 "<b>SynchronousOff</b> = " +
903 String.valueOf(isSynchronousOff()
904 ) +
905 " <br/> " +
906
907 "<b>SyncNavPointsOff</b> = " +
908 String.valueOf(isSyncNavPointsOff()
909 ) +
910 " <br/> " +
911
912 "<b>AutoPickupOff</b> = " +
913 String.valueOf(isAutoPickupOff()
914 ) +
915 " <br/> " +
916
917 "<br/>]"
918 ;
919 }
920
921 public String toMessage() {
922 StringBuffer buf = new StringBuffer();
923 buf.append("CONF");
924
925 if (Id != null) {
926 buf.append(" {Id " + Id.getStringId() + "}");
927 }
928
929 if (AutoTrace != null) {
930 buf.append(" {AutoTrace " + AutoTrace + "}");
931 }
932
933 if (ManualSpawn != null) {
934 buf.append(" {ManualSpawn " + ManualSpawn + "}");
935 }
936
937 if (Name != null) {
938 buf.append(" {Name " + Name + "}");
939 }
940
941 if (Action != null) {
942 buf.append(" {Action " + Action + "}");
943 }
944
945 if (SpeedMultiplier != null) {
946 buf.append(" {SpeedMultiplier " + SpeedMultiplier + "}");
947 }
948
949 if (RotationRate != null) {
950 buf.append(" {RotationRate " +
951 RotationRate.getPitch() + "," +
952 RotationRate.getYaw() + "," +
953 RotationRate.getRoll() + "}");
954 }
955
956 if (Invulnerable != null) {
957 buf.append(" {Invulnerable " + Invulnerable + "}");
958 }
959
960 if (VisionTime != null) {
961 buf.append(" {VisionTime " + VisionTime + "}");
962 }
963
964 if (ShowDebug != null) {
965 buf.append(" {ShowDebug " + ShowDebug + "}");
966 }
967
968 if (ShowFocalPoint != null) {
969 buf.append(" {ShowFocalPoint " + ShowFocalPoint + "}");
970 }
971
972 if (DrawTraceLines != null) {
973 buf.append(" {DrawTraceLines " + DrawTraceLines + "}");
974 }
975
976 if (SynchronousOff != null) {
977 buf.append(" {SynchronousOff " + SynchronousOff + "}");
978 }
979
980 if (SyncNavPointsOff != null) {
981 buf.append(" {SyncNavPointsOff " + SyncNavPointsOff + "}");
982 }
983
984 if (AutoPickupOff != null) {
985 buf.append(" {AutoPickupOff " + AutoPickupOff + "}");
986 }
987
988 return buf.toString();
989 }
990
991
992
993
994
995
996
997 public void copy(ConfigChange confCh) {
998 setAutoPickupOff(confCh.isAutoPickupOff());
999 setAutoTrace(confCh.isAutoTrace());
1000 setDrawTraceLines(confCh.isDrawTraceLines());
1001 setInvulnerable(confCh.isInvulnerable());
1002 setManualSpawn(confCh.isManualSpawn());
1003 setShowDebug(confCh.isShowDebug());
1004 setShowFocalPoint(confCh.isShowFocalPoint());
1005 setSynchronousOff(confCh.isSynchronousOff());
1006 }
1007
1008
1009
1010 }
1011