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