1
2 /**
3 IMPORTANT !!!
4
5 DO NOT EDIT THIS FILE. IT IS GENERATED FROM approriate xml file in xmlresources/gbcommands BY
6 THE JavaClassesGenerator.xslt. MODIFY THAT FILE INSTEAD OF THIS ONE.
7
8 Use Ant task process-gb-messages after that to generate .java files again.
9
10 IMPORTANT END !!!
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 * Representation of the GameBots2004 command CONF.
15 *
16 *
17 Configures various attributes of the bot. This command can be
18 issued also by bot on the bot itself (in this case Id attribute
19 is not parsed).
20
21 */
22 public class Configuration
23 extends CommandMessage
24 {
25
26
27 /** Example how the message looks like - used during parser tests. */
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 * Creates new instance of command Configuration.
33 *
34 Configures various attributes of the bot. This command can be
35 issued also by bot on the bot itself (in this case Id attribute
36 is not parsed).
37
38 * Corresponding GameBots message for this command is
39 * CONF.
40 *
41 *
42 * @param Id
43 Id of the target bot. Not used if sent as a command for the
44 bot.
45
46 * @param AutoTrace
47 Enables/disables auto ray tracing feature.
48
49 * @param ManualSpawn
50 Sets if the bot wil have tol be respawned after death
51 manually by RESPAWN command. If false, the bot will respawn
52 automatically.
53
54 * @param Name
55 You can change the name of the bot in the game.
56
57 * @param Action
58 Sets atomic action for the bot (BDI).
59
60 * @param SpeedMultiplier
61 Bots default speed will be multiplied by this number. Ranges from 0.1 to 2 (default, can be set in ini in [GameBots2004.RemoteBot] MaxSpeed).
62
63 * @param RotationRate
64 Sets the bot rotation rate. Default rotation rate is: (Pitch=3072,Yaw=60000,Roll=2048) and may be configured in ini file in [GameBots2004.RemoteBot] DefaultRotationRate. (pitch - up/down, yaw - left/right, roll - equivalent of doing a cartwheel)
65
66 * @param Invulnerable
67 Will set godmode for bot on (bot can't be killed). This can
68 be changed just when cheating is enabled on the server.
69 (bAllowCheats = True)
70
71 * @param VisionTime
72 Between 0.1 to 2 seconds, it sets the delay between two
73 synchronous batches.
74
75 * @param ShowDebug
76 If true some additional debug information will be logged to
77 UT2004 server console window.
78
79 * @param ShowFocalPoint
80 If set to true an actor will appear in the game on the
81 location the bot is actually looking at.
82
83 * @param DrawTraceLines
84 If set to true, the rays of automatic ray tracing (ATR
85 messages) will be drawn in the game.
86
87 * @param SynchronousOff
88 It enables/disables sending of all GB synchronous messages
89 for the bot.
90
91 * @param SyncNavPointsOff
92 It enables/disables sending of NavPoints in GB synchronous batch for the bot.
93
94 * @param AutoPickupOff
95 It enables/disables automatic pickup of the bot. If true the items can be picked up through PICK command.
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 * Creates new instance of command Configuration.
137 *
138 Configures various attributes of the bot. This command can be
139 issued also by bot on the bot itself (in this case Id attribute
140 is not parsed).
141
142 * Corresponding GameBots message for this command is
143 * CONF.
144 * <p></p>
145 * WARNING: this is empty-command constructor, you have to use setters to fill it up with data that should be sent to GameBots2004!
146 */
147 public Configuration() {
148 }
149
150
151 /**
152 * Cloning constructor.
153 *
154 * @param original
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 Id of the target bot. Not used if sent as a command for the
193 bot.
194
195 */
196 protected
197 UnrealId Id =
198
199 null
200 ;
201
202
203
204 /**
205 *
206 Id of the target bot. Not used if sent as a command for the
207 bot.
208
209 */
210 public UnrealId getId()
211
212 {
213 return
214 Id;
215 }
216
217
218
219
220 /**
221 *
222 Id of the target bot. Not used if sent as a command for the
223 bot.
224
225 */
226 public Configuration
227 setId(UnrealId Id)
228
229 {
230 this.Id = Id;
231 return this;
232 }
233
234 /**
235
236 Enables/disables auto ray tracing feature.
237
238 */
239 protected
240 Boolean AutoTrace =
241
242 null
243 ;
244
245
246
247 /**
248 *
249 Enables/disables auto ray tracing feature.
250
251 */
252 public Boolean isAutoTrace()
253
254 {
255 return
256 AutoTrace;
257 }
258
259
260
261
262 /**
263 *
264 Enables/disables auto ray tracing feature.
265
266 */
267 public Configuration
268 setAutoTrace(Boolean AutoTrace)
269
270 {
271 this.AutoTrace = AutoTrace;
272 return this;
273 }
274
275 /**
276
277 Sets if the bot wil have tol be respawned after death
278 manually by RESPAWN command. If false, the bot will respawn
279 automatically.
280
281 */
282 protected
283 Boolean ManualSpawn =
284
285 null
286 ;
287
288
289
290 /**
291 *
292 Sets if the bot wil have tol be respawned after death
293 manually by RESPAWN command. If false, the bot will respawn
294 automatically.
295
296 */
297 public Boolean isManualSpawn()
298
299 {
300 return
301 ManualSpawn;
302 }
303
304
305
306
307 /**
308 *
309 Sets if the bot wil have tol be respawned after death
310 manually by RESPAWN command. If false, the bot will respawn
311 automatically.
312
313 */
314 public Configuration
315 setManualSpawn(Boolean ManualSpawn)
316
317 {
318 this.ManualSpawn = ManualSpawn;
319 return this;
320 }
321
322 /**
323
324 You can change the name of the bot in the game.
325
326 */
327 protected
328 String Name =
329
330 null
331 ;
332
333
334
335 /**
336 *
337 You can change the name of the bot in the game.
338
339 */
340 public String getName()
341
342 {
343 return
344 Name;
345 }
346
347
348
349
350 /**
351 *
352 You can change the name of the bot in the game.
353
354 */
355 public Configuration
356 setName(String Name)
357
358 {
359 this.Name = Name;
360 return this;
361 }
362
363 /**
364
365 Sets atomic action for the bot (BDI).
366
367 */
368 protected
369 String Action =
370
371 null
372 ;
373
374
375
376 /**
377 *
378 Sets atomic action for the bot (BDI).
379
380 */
381 public String getAction()
382
383 {
384 return
385 Action;
386 }
387
388
389
390
391 /**
392 *
393 Sets atomic action for the bot (BDI).
394
395 */
396 public Configuration
397 setAction(String Action)
398
399 {
400 this.Action = Action;
401 return this;
402 }
403
404 /**
405
406 Bots default speed will be multiplied by this number. Ranges from 0.1 to 2 (default, can be set in ini in [GameBots2004.RemoteBot] MaxSpeed).
407
408 */
409 protected
410 Double SpeedMultiplier =
411
412 null
413 ;
414
415
416
417 /**
418 *
419 Bots default speed will be multiplied by this number. Ranges from 0.1 to 2 (default, can be set in ini in [GameBots2004.RemoteBot] MaxSpeed).
420
421 */
422 public Double getSpeedMultiplier()
423
424 {
425 return
426 SpeedMultiplier;
427 }
428
429
430
431
432 /**
433 *
434 Bots default speed will be multiplied by this number. Ranges from 0.1 to 2 (default, can be set in ini in [GameBots2004.RemoteBot] MaxSpeed).
435
436 */
437 public Configuration
438 setSpeedMultiplier(Double SpeedMultiplier)
439
440 {
441 this.SpeedMultiplier = SpeedMultiplier;
442 return this;
443 }
444
445 /**
446
447 Sets the bot rotation rate. Default rotation rate is: (Pitch=3072,Yaw=60000,Roll=2048) and may be configured in ini file in [GameBots2004.RemoteBot] DefaultRotationRate. (pitch - up/down, yaw - left/right, roll - equivalent of doing a cartwheel)
448
449 */
450 protected
451 Rotation RotationRate =
452
453 null
454 ;
455
456
457
458 /**
459 *
460 Sets the bot rotation rate. Default rotation rate is: (Pitch=3072,Yaw=60000,Roll=2048) and may be configured in ini file in [GameBots2004.RemoteBot] DefaultRotationRate. (pitch - up/down, yaw - left/right, roll - equivalent of doing a cartwheel)
461
462 */
463 public Rotation getRotationRate()
464
465 {
466 return
467 RotationRate;
468 }
469
470
471
472
473 /**
474 *
475 Sets the bot rotation rate. Default rotation rate is: (Pitch=3072,Yaw=60000,Roll=2048) and may be configured in ini file in [GameBots2004.RemoteBot] DefaultRotationRate. (pitch - up/down, yaw - left/right, roll - equivalent of doing a cartwheel)
476
477 */
478 public Configuration
479 setRotationRate(Rotation RotationRate)
480
481 {
482 this.RotationRate = RotationRate;
483 return this;
484 }
485
486 /**
487
488 Will set godmode for bot on (bot can't be killed). This can
489 be changed just when cheating is enabled on the server.
490 (bAllowCheats = True)
491
492 */
493 protected
494 Boolean Invulnerable =
495
496 null
497 ;
498
499
500
501 /**
502 *
503 Will set godmode for bot on (bot can't be killed). This can
504 be changed just when cheating is enabled on the server.
505 (bAllowCheats = True)
506
507 */
508 public Boolean isInvulnerable()
509
510 {
511 return
512 Invulnerable;
513 }
514
515
516
517
518 /**
519 *
520 Will set godmode for bot on (bot can't be killed). This can
521 be changed just when cheating is enabled on the server.
522 (bAllowCheats = True)
523
524 */
525 public Configuration
526 setInvulnerable(Boolean Invulnerable)
527
528 {
529 this.Invulnerable = Invulnerable;
530 return this;
531 }
532
533 /**
534
535 Between 0.1 to 2 seconds, it sets the delay between two
536 synchronous batches.
537
538 */
539 protected
540 Double VisionTime =
541
542 null
543 ;
544
545
546
547 /**
548 *
549 Between 0.1 to 2 seconds, it sets the delay between two
550 synchronous batches.
551
552 */
553 public Double getVisionTime()
554
555 {
556 return
557 VisionTime;
558 }
559
560
561
562
563 /**
564 *
565 Between 0.1 to 2 seconds, it sets the delay between two
566 synchronous batches.
567
568 */
569 public Configuration
570 setVisionTime(Double VisionTime)
571
572 {
573 this.VisionTime = VisionTime;
574 return this;
575 }
576
577 /**
578
579 If true some additional debug information will be logged to
580 UT2004 server console window.
581
582 */
583 protected
584 Boolean ShowDebug =
585
586 null
587 ;
588
589
590
591 /**
592 *
593 If true some additional debug information will be logged to
594 UT2004 server console window.
595
596 */
597 public Boolean isShowDebug()
598
599 {
600 return
601 ShowDebug;
602 }
603
604
605
606
607 /**
608 *
609 If true some additional debug information will be logged to
610 UT2004 server console window.
611
612 */
613 public Configuration
614 setShowDebug(Boolean ShowDebug)
615
616 {
617 this.ShowDebug = ShowDebug;
618 return this;
619 }
620
621 /**
622
623 If set to true an actor will appear in the game on the
624 location the bot is actually looking at.
625
626 */
627 protected
628 Boolean ShowFocalPoint =
629
630 null
631 ;
632
633
634
635 /**
636 *
637 If set to true an actor will appear in the game on the
638 location the bot is actually looking at.
639
640 */
641 public Boolean isShowFocalPoint()
642
643 {
644 return
645 ShowFocalPoint;
646 }
647
648
649
650
651 /**
652 *
653 If set to true an actor will appear in the game on the
654 location the bot is actually looking at.
655
656 */
657 public Configuration
658 setShowFocalPoint(Boolean ShowFocalPoint)
659
660 {
661 this.ShowFocalPoint = ShowFocalPoint;
662 return this;
663 }
664
665 /**
666
667 If set to true, the rays of automatic ray tracing (ATR
668 messages) will be drawn in the game.
669
670 */
671 protected
672 Boolean DrawTraceLines =
673
674 null
675 ;
676
677
678
679 /**
680 *
681 If set to true, the rays of automatic ray tracing (ATR
682 messages) will be drawn in the game.
683
684 */
685 public Boolean isDrawTraceLines()
686
687 {
688 return
689 DrawTraceLines;
690 }
691
692
693
694
695 /**
696 *
697 If set to true, the rays of automatic ray tracing (ATR
698 messages) will be drawn in the game.
699
700 */
701 public Configuration
702 setDrawTraceLines(Boolean DrawTraceLines)
703
704 {
705 this.DrawTraceLines = DrawTraceLines;
706 return this;
707 }
708
709 /**
710
711 It enables/disables sending of all GB synchronous messages
712 for the bot.
713
714 */
715 protected
716 Boolean SynchronousOff =
717
718 null
719 ;
720
721
722
723 /**
724 *
725 It enables/disables sending of all GB synchronous messages
726 for the bot.
727
728 */
729 public Boolean isSynchronousOff()
730
731 {
732 return
733 SynchronousOff;
734 }
735
736
737
738
739 /**
740 *
741 It enables/disables sending of all GB synchronous messages
742 for the bot.
743
744 */
745 public Configuration
746 setSynchronousOff(Boolean SynchronousOff)
747
748 {
749 this.SynchronousOff = SynchronousOff;
750 return this;
751 }
752
753 /**
754
755 It enables/disables sending of NavPoints in GB synchronous batch for the bot.
756
757 */
758 protected
759 Boolean SyncNavPointsOff =
760
761 null
762 ;
763
764
765
766 /**
767 *
768 It enables/disables sending of NavPoints in GB synchronous batch for the bot.
769
770 */
771 public Boolean isSyncNavPointsOff()
772
773 {
774 return
775 SyncNavPointsOff;
776 }
777
778
779
780
781 /**
782 *
783 It enables/disables sending of NavPoints in GB synchronous batch for the bot.
784
785 */
786 public Configuration
787 setSyncNavPointsOff(Boolean SyncNavPointsOff)
788
789 {
790 this.SyncNavPointsOff = SyncNavPointsOff;
791 return this;
792 }
793
794 /**
795
796 It enables/disables automatic pickup of the bot. If true the items can be picked up through PICK command.
797
798 */
799 protected
800 Boolean AutoPickupOff =
801
802 null
803 ;
804
805
806
807 /**
808 *
809 It enables/disables automatic pickup of the bot. If true the items can be picked up through PICK command.
810
811 */
812 public Boolean isAutoPickupOff()
813
814 {
815 return
816 AutoPickupOff;
817 }
818
819
820
821
822 /**
823 *
824 It enables/disables automatic pickup of the bot. If true the items can be picked up through PICK command.
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 // --- Extra Java from XML BEGIN (extra/code/java)
992
993
994 /**
995 * Copy configuration from existing info message to this command.
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 // --- Extra Java from XML END (extra/code/java)
1009
1010 }
1011