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