View Javadoc

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 THESE FILES INSTEAD OF THIS ONE.
7   
8               IMPORTANT END !!!
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  		Configures various attributes of the bot. This command can be
36  		issued also by bot on the bot itself (in this case Id attribute
37  		is not parsed).
38  	
39                            Corresponding GameBots command is
40                            CONF.
41                        
42               */
43              
44              public class
45              Configuration extends
46          CommandMessage
47  
48              {
49              
50              /**
51                Creates new instance of command Configuration.
52                
53  		Configures various attributes of the bot. This command can be
54  		issued also by bot on the bot itself (in this case Id attribute
55  		is not parsed).
56  	Corresponding GameBots message for this command is
57                CONF.
58                    @param Id 
59  			Id of the target bot. Not used if sent as a command for the
60  			bot.
61  		
62                    @param AutoTrace 
63  			Enables/disables auto ray tracing feature.
64  		
65                    @param ManualSpawn 
66  			Sets if the bot wil have tol be respawned after death
67  			manually by RESPAWN command. If false, the bot will respawn
68  			automatically.
69  		
70                    @param Name 
71  			You can change the name of the bot in the game.
72  		
73                    @param Action 
74  			Sets atomic action for the bot (BDI).
75  		
76                    @param SpeedMultiplier 
77  			Bots default speed will be multiplied by this number. Ranges from 0.1 to 2 (default, can be set in ini in [GameBotsUDK.RemoteBot] MaxSpeed).
78  		
79                    @param RotationRate 
80  			Sets the bot rotation rate. Default rotation rate is: (Pitch=3072,Yaw=60000,Roll=2048) and may be configured in ini file in [GameBotsUDK.RemoteBot] DefaultRotationRate. (pitch - up/down, yaw - left/right, roll - equivalent of doing a cartwheel)
81  		
82                    @param Invulnerable 
83  			Will set godmode for bot on (bot can't be killed). This can
84  			be changed just when cheating is enabled on the server.
85  			(bAllowCheats = True)
86  		
87                    @param VisionTime 
88  			Between 0.1 to 2 seconds, it sets the delay between two
89  			synchronous batches.
90  		
91                    @param ShowDebug 
92  			If true some additional debug information will be logged to
93  			UDK server console window.
94  		
95                    @param ShowFocalPoint 
96  			If set to true an actor will appear in the game on the
97  			location the bot is actually looking at.
98  		
99                    @param DrawTraceLines 
100 			If set to true, the rays of automatic ray tracing (ATR
101 			messages) will be drawn in the game.
102 		
103                   @param SynchronousOff 
104 			It enables/disables sending of all GB synchronous messages
105 			for the bot.
106 		
107                   @param AutoPickupOff 
108 			It enables/disables automatic pickup of the bot. If true the items can be picked up through PICK command.
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 		             Creates new instance of command Configuration.
147 		             
148 		Configures various attributes of the bot. This command can be
149 		issued also by bot on the bot itself (in this case Id attribute
150 		is not parsed).
151 	Corresponding GameBots message for this command is
152 		             CONF.
153 		             <p></p>WARNING: this is empty-command constructor, you have to use setters to fill it up!
154 		             */
155             		public  Configuration() {
156             		}
157             	
158 
159             /////// Properties BEGIN
160             
161         /**
162         
163 			Id of the target bot. Not used if sent as a command for the
164 			bot.
165 		 */
166         protected
167          UnrealId Id =
168         	null;
169 
170         
171         /**
172         
173 			Id of the target bot. Not used if sent as a command for the
174 			bot.
175 		 */
176         public
177         UnrealId getId() {
178             return
179          Id;
180         }
181         
182 
183         
184             /**
185         
186 			Id of the target bot. Not used if sent as a command for the
187 			bot.
188 		 */
189         public Configuration setId(UnrealId Id) {
190             this.Id = Id;
191             return this;
192             }
193        
194         /**
195         
196 			Enables/disables auto ray tracing feature.
197 		 */
198         protected
199          boolean AutoTrace =
200         	false;
201 
202         
203         /**
204         
205 			Enables/disables auto ray tracing feature.
206 		 */
207         public
208         boolean isAutoTrace() {
209             return
210          AutoTrace;
211         }
212         
213 
214         
215             /**
216         
217 			Enables/disables auto ray tracing feature.
218 		 */
219         public Configuration setAutoTrace(boolean AutoTrace) {
220             this.AutoTrace = AutoTrace;
221             return this;
222             }
223        
224         /**
225         
226 			Sets if the bot wil have tol be respawned after death
227 			manually by RESPAWN command. If false, the bot will respawn
228 			automatically.
229 		 */
230         protected
231          boolean ManualSpawn =
232         	false;
233 
234         
235         /**
236         
237 			Sets if the bot wil have tol be respawned after death
238 			manually by RESPAWN command. If false, the bot will respawn
239 			automatically.
240 		 */
241         public
242         boolean isManualSpawn() {
243             return
244          ManualSpawn;
245         }
246         
247 
248         
249             /**
250         
251 			Sets if the bot wil have tol be respawned after death
252 			manually by RESPAWN command. If false, the bot will respawn
253 			automatically.
254 		 */
255         public Configuration setManualSpawn(boolean ManualSpawn) {
256             this.ManualSpawn = ManualSpawn;
257             return this;
258             }
259        
260         /**
261         
262 			You can change the name of the bot in the game.
263 		 */
264         protected
265          String Name =
266         	null;
267 
268         
269         /**
270         
271 			You can change the name of the bot in the game.
272 		 */
273         public
274         String getName() {
275             return
276          Name;
277         }
278         
279 
280         
281             /**
282         
283 			You can change the name of the bot in the game.
284 		 */
285         public Configuration setName(String Name) {
286             this.Name = Name;
287             return this;
288             }
289        
290         /**
291         
292 			Sets atomic action for the bot (BDI).
293 		 */
294         protected
295          String Action =
296         	null;
297 
298         
299         /**
300         
301 			Sets atomic action for the bot (BDI).
302 		 */
303         public
304         String getAction() {
305             return
306          Action;
307         }
308         
309 
310         
311             /**
312         
313 			Sets atomic action for the bot (BDI).
314 		 */
315         public Configuration setAction(String Action) {
316             this.Action = Action;
317             return this;
318             }
319        
320         /**
321         
322 			Bots default speed will be multiplied by this number. Ranges from 0.1 to 2 (default, can be set in ini in [GameBotsUDK.RemoteBot] MaxSpeed).
323 		 */
324         protected
325          double SpeedMultiplier =
326         	0;
327 
328         
329         /**
330         
331 			Bots default speed will be multiplied by this number. Ranges from 0.1 to 2 (default, can be set in ini in [GameBotsUDK.RemoteBot] MaxSpeed).
332 		 */
333         public
334         double getSpeedMultiplier() {
335             return
336          SpeedMultiplier;
337         }
338         
339 
340         
341             /**
342         
343 			Bots default speed will be multiplied by this number. Ranges from 0.1 to 2 (default, can be set in ini in [GameBotsUDK.RemoteBot] MaxSpeed).
344 		 */
345         public Configuration setSpeedMultiplier(double SpeedMultiplier) {
346             this.SpeedMultiplier = SpeedMultiplier;
347             return this;
348             }
349        
350         /**
351         
352 			Sets the bot rotation rate. Default rotation rate is: (Pitch=3072,Yaw=60000,Roll=2048) and may be configured in ini file in [GameBotsUDK.RemoteBot] DefaultRotationRate. (pitch - up/down, yaw - left/right, roll - equivalent of doing a cartwheel)
353 		 */
354         protected
355          Rotation RotationRate =
356         	null;
357 
358         
359         /**
360         
361 			Sets the bot rotation rate. Default rotation rate is: (Pitch=3072,Yaw=60000,Roll=2048) and may be configured in ini file in [GameBotsUDK.RemoteBot] DefaultRotationRate. (pitch - up/down, yaw - left/right, roll - equivalent of doing a cartwheel)
362 		 */
363         public
364         Rotation getRotationRate() {
365             return
366          RotationRate;
367         }
368         
369 
370         
371             /**
372         
373 			Sets the bot rotation rate. Default rotation rate is: (Pitch=3072,Yaw=60000,Roll=2048) and may be configured in ini file in [GameBotsUDK.RemoteBot] DefaultRotationRate. (pitch - up/down, yaw - left/right, roll - equivalent of doing a cartwheel)
374 		 */
375         public Configuration setRotationRate(Rotation RotationRate) {
376             this.RotationRate = RotationRate;
377             return this;
378             }
379        
380         /**
381         
382 			Will set godmode for bot on (bot can't be killed). This can
383 			be changed just when cheating is enabled on the server.
384 			(bAllowCheats = True)
385 		 */
386         protected
387          boolean Invulnerable =
388         	false;
389 
390         
391         /**
392         
393 			Will set godmode for bot on (bot can't be killed). This can
394 			be changed just when cheating is enabled on the server.
395 			(bAllowCheats = True)
396 		 */
397         public
398         boolean isInvulnerable() {
399             return
400          Invulnerable;
401         }
402         
403 
404         
405             /**
406         
407 			Will set godmode for bot on (bot can't be killed). This can
408 			be changed just when cheating is enabled on the server.
409 			(bAllowCheats = True)
410 		 */
411         public Configuration setInvulnerable(boolean Invulnerable) {
412             this.Invulnerable = Invulnerable;
413             return this;
414             }
415        
416         /**
417         
418 			Between 0.1 to 2 seconds, it sets the delay between two
419 			synchronous batches.
420 		 */
421         protected
422          double VisionTime =
423         	0;
424 
425         
426         /**
427         
428 			Between 0.1 to 2 seconds, it sets the delay between two
429 			synchronous batches.
430 		 */
431         public
432         double getVisionTime() {
433             return
434          VisionTime;
435         }
436         
437 
438         
439             /**
440         
441 			Between 0.1 to 2 seconds, it sets the delay between two
442 			synchronous batches.
443 		 */
444         public Configuration setVisionTime(double VisionTime) {
445             this.VisionTime = VisionTime;
446             return this;
447             }
448        
449         /**
450         
451 			If true some additional debug information will be logged to
452 			UDK server console window.
453 		 */
454         protected
455          boolean ShowDebug =
456         	false;
457 
458         
459         /**
460         
461 			If true some additional debug information will be logged to
462 			UDK server console window.
463 		 */
464         public
465         boolean isShowDebug() {
466             return
467          ShowDebug;
468         }
469         
470 
471         
472             /**
473         
474 			If true some additional debug information will be logged to
475 			UDK server console window.
476 		 */
477         public Configuration setShowDebug(boolean ShowDebug) {
478             this.ShowDebug = ShowDebug;
479             return this;
480             }
481        
482         /**
483         
484 			If set to true an actor will appear in the game on the
485 			location the bot is actually looking at.
486 		 */
487         protected
488          boolean ShowFocalPoint =
489         	false;
490 
491         
492         /**
493         
494 			If set to true an actor will appear in the game on the
495 			location the bot is actually looking at.
496 		 */
497         public
498         boolean isShowFocalPoint() {
499             return
500          ShowFocalPoint;
501         }
502         
503 
504         
505             /**
506         
507 			If set to true an actor will appear in the game on the
508 			location the bot is actually looking at.
509 		 */
510         public Configuration setShowFocalPoint(boolean ShowFocalPoint) {
511             this.ShowFocalPoint = ShowFocalPoint;
512             return this;
513             }
514        
515         /**
516         
517 			If set to true, the rays of automatic ray tracing (ATR
518 			messages) will be drawn in the game.
519 		 */
520         protected
521          boolean DrawTraceLines =
522         	false;
523 
524         
525         /**
526         
527 			If set to true, the rays of automatic ray tracing (ATR
528 			messages) will be drawn in the game.
529 		 */
530         public
531         boolean isDrawTraceLines() {
532             return
533          DrawTraceLines;
534         }
535         
536 
537         
538             /**
539         
540 			If set to true, the rays of automatic ray tracing (ATR
541 			messages) will be drawn in the game.
542 		 */
543         public Configuration setDrawTraceLines(boolean DrawTraceLines) {
544             this.DrawTraceLines = DrawTraceLines;
545             return this;
546             }
547        
548         /**
549         
550 			It enables/disables sending of all GB synchronous messages
551 			for the bot.
552 		 */
553         protected
554          boolean SynchronousOff =
555         	false;
556 
557         
558         /**
559         
560 			It enables/disables sending of all GB synchronous messages
561 			for the bot.
562 		 */
563         public
564         boolean isSynchronousOff() {
565             return
566          SynchronousOff;
567         }
568         
569 
570         
571             /**
572         
573 			It enables/disables sending of all GB synchronous messages
574 			for the bot.
575 		 */
576         public Configuration setSynchronousOff(boolean SynchronousOff) {
577             this.SynchronousOff = SynchronousOff;
578             return this;
579             }
580        
581         /**
582         
583 			It enables/disables automatic pickup of the bot. If true the items can be picked up through PICK command.
584 		 */
585         protected
586          boolean AutoPickupOff =
587         	false;
588 
589         
590         /**
591         
592 			It enables/disables automatic pickup of the bot. If true the items can be picked up through PICK command.
593 		 */
594         public
595         boolean isAutoPickupOff() {
596             return
597          AutoPickupOff;
598         }
599         
600 
601         
602             /**
603         
604 			It enables/disables automatic pickup of the bot. If true the items can be picked up through PICK command.
605 		 */
606         public Configuration setAutoPickupOff(boolean AutoPickupOff) {
607             this.AutoPickupOff = AutoPickupOff;
608             return this;
609             }
610        
611             /////// Properties END
612 
613             /////// Extra Java code BEGIN
614 
615             	/////// Additional code from xslt BEGIN
616             		
617 
618 
619             	/////// Additional code from xslt END
620 
621 	            /////// Extra Java from XML BEGIN
622             		
623                         
624                         /**
625                         * Copy configuration from existing info message to this command.
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             	/////// Extra Java from XML END
639 
640             /////// Extra Java code END
641 
642             
643 
644             /**
645               * Cloning constructor.
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