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 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.*;
13   		/**
14   		 * Representation of the GameBots2004 command INIT.
15   		 *
16   		 * 
17  		Message you'll send at the beginning of the communication to
18  		create a bot in the game. You must send this message before you
19  		can have a character to play in the game.
20  	
21           */
22   	public class Initialize 
23  		extends CommandMessage
24  	        {
25  	        	
26  		        
27      	/** Example how the message looks like - used during parser tests. */
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}  {Jmx text}  {ClassName text} ";
30      
31  		/**
32  		 * Creates new instance of command Initialize.
33  		 * 
34  		Message you'll send at the beginning of the communication to
35  		create a bot in the game. You must send this message before you
36  		can have a character to play in the game.
37  	
38  		 * Corresponding GameBots message for this command is
39  		 * INIT.
40  		 *
41  		 * 
42  		 *    @param Name Desired name.
43  		 *    @param Team 
44  			Preferred team. If illegal or no team provided, one will be
45  			provided for you. Normally a team game has team 0 and team
46  			1. In BotDeathMatch, team is meaningless.
47  		
48  		 *    @param ManualSpawn 
49  			Sets if the bot wil have tol be respawned after death
50  			manually by RESPAWN command. If false, the bot will respawn
51  			automatically.
52  		
53  		 *    @param AutoTrace 
54  			Enables/disables auto ray tracing feature.
55  		
56  		 *    @param Location 
57  			Specify start location, if unspecified, then random.
58  		
59  		 *    @param Rotation 
60  			Specify start rotation, if unspecified, then random.
61  		
62  		 *    @param Skin 
63  			Sets the bot current skin (e.g. "HumanMaleA.MercMaleA").
64  			Find all packages and skins through unrealEd (Actor browser,
65  			search in UT2004/Animations folder). Supported bot skins are
66  			Aliens (Aliens.), Bots (Bot.), human males (HumanMaleA.),
67  			human females (HumanFemaleA. ), juggernauts (Jugg.). Skaarj
68  			skins are not supported at the time being.
69  		
70  		 *    @param DesiredSkill 
71  			Can range from 0 to 7. This sets the bot accuracy. 1 lowest,
72  			7 highest. Shouldn't have any other effect.
73  		
74  		 *    @param ShouldLeadTarget 
75  			When firing slow projectiles (missiles...), if the engine
76  			will try to count the impact point for the bot or not (when
77  			shooting at moving targets).
78  		
79  		 *    @param AutoPickupOff 
80  			It enables/disables automatic pickup of the bot. If true the items can be picked up through PICK command.
81  		
82  		 *    @param Jmx 
83  			Sets the jmx adress we can use to debug the bot from Java (if we are using Pogamut).
84  		
85  		 *    @param ClassName 
86  			Sets the Unreal Tournament class of the bot that should be used. By default leave it blank. In UnrealRuntime2 it may be used to spawn bots of different class.
87  		
88  		 */
89  		public Initialize(
90  			String Name,  Integer Team,  Boolean ManualSpawn,  Boolean AutoTrace,  Location Location,  Rotation Rotation,  String Skin,  Integer DesiredSkill,  Boolean ShouldLeadTarget,  Boolean AutoPickupOff,  String Jmx,  String ClassName
91  		) {
92  			
93  				this.Name = Name;
94              
95  				this.Team = Team;
96              
97  				this.ManualSpawn = ManualSpawn;
98              
99  				this.AutoTrace = AutoTrace;
100             
101 				this.Location = Location;
102             
103 				this.Rotation = Rotation;
104             
105 				this.Skin = Skin;
106             
107 				this.DesiredSkill = DesiredSkill;
108             
109 				this.ShouldLeadTarget = ShouldLeadTarget;
110             
111 				this.AutoPickupOff = AutoPickupOff;
112             
113 				this.Jmx = Jmx;
114             
115 				this.ClassName = ClassName;
116             
117 		}
118 
119 		
120 			/**
121 			 * Creates new instance of command Initialize.
122 			 * 
123 		Message you'll send at the beginning of the communication to
124 		create a bot in the game. You must send this message before you
125 		can have a character to play in the game.
126 	
127 			 * Corresponding GameBots message for this command is
128 			 * INIT.
129 			 * <p></p>
130 			 * WARNING: this is empty-command constructor, you have to use setters to fill it up with data that should be sent to GameBots2004!
131 		     */
132 		    public Initialize() {
133 		    }
134 			
135 		
136 		/**
137 		 * Cloning constructor.
138 		 *
139 		 * @param original
140 		 */
141 		public Initialize(Initialize original) {
142 		   
143 		        this.Name = original.Name;
144 		   
145 		        this.Team = original.Team;
146 		   
147 		        this.ManualSpawn = original.ManualSpawn;
148 		   
149 		        this.AutoTrace = original.AutoTrace;
150 		   
151 		        this.Location = original.Location;
152 		   
153 		        this.Rotation = original.Rotation;
154 		   
155 		        this.Skin = original.Skin;
156 		   
157 		        this.DesiredSkill = original.DesiredSkill;
158 		   
159 		        this.ShouldLeadTarget = original.ShouldLeadTarget;
160 		   
161 		        this.AutoPickupOff = original.AutoPickupOff;
162 		   
163 		        this.Jmx = original.Jmx;
164 		   
165 		        this.ClassName = original.ClassName;
166 		   
167 		}
168     
169 	        /**
170 	        Desired name. 
171 	        */
172 	        protected
173 	         String Name =
174 	       	
175 	        		null
176 	        	;
177 	
178 	        
179 	        
180  		/**
181          * Desired name. 
182          */
183         public String getName()
184  	
185 	        {
186 	            return
187 	        	 Name;
188 	        }
189 	        
190 	        
191 	        
192  		
193  		/**
194          * Desired name. 
195          */
196         public Initialize 
197         setName(String Name)
198  	
199 			{
200 				this.Name = Name;
201 				return this;
202 			}
203 		
204 	        /**
205 	        
206 			Preferred team. If illegal or no team provided, one will be
207 			provided for you. Normally a team game has team 0 and team
208 			1. In BotDeathMatch, team is meaningless.
209 		 
210 	        */
211 	        protected
212 	         Integer Team =
213 	       	
214 	        		null
215 	        	;
216 	
217 	        
218 	        
219  		/**
220          * 
221 			Preferred team. If illegal or no team provided, one will be
222 			provided for you. Normally a team game has team 0 and team
223 			1. In BotDeathMatch, team is meaningless.
224 		 
225          */
226         public Integer getTeam()
227  	
228 	        {
229 	            return
230 	        	 Team;
231 	        }
232 	        
233 	        
234 	        
235  		
236  		/**
237          * 
238 			Preferred team. If illegal or no team provided, one will be
239 			provided for you. Normally a team game has team 0 and team
240 			1. In BotDeathMatch, team is meaningless.
241 		 
242          */
243         public Initialize 
244         setTeam(Integer Team)
245  	
246 			{
247 				this.Team = Team;
248 				return this;
249 			}
250 		
251 	        /**
252 	        
253 			Sets if the bot wil have tol be respawned after death
254 			manually by RESPAWN command. If false, the bot will respawn
255 			automatically.
256 		 
257 	        */
258 	        protected
259 	         Boolean ManualSpawn =
260 	       	
261 	        		null
262 	        	;
263 	
264 	        
265 	        
266  		/**
267          * 
268 			Sets if the bot wil have tol be respawned after death
269 			manually by RESPAWN command. If false, the bot will respawn
270 			automatically.
271 		 
272          */
273         public Boolean isManualSpawn()
274  	
275 	        {
276 	            return
277 	        	 ManualSpawn;
278 	        }
279 	        
280 	        
281 	        
282  		
283  		/**
284          * 
285 			Sets if the bot wil have tol be respawned after death
286 			manually by RESPAWN command. If false, the bot will respawn
287 			automatically.
288 		 
289          */
290         public Initialize 
291         setManualSpawn(Boolean ManualSpawn)
292  	
293 			{
294 				this.ManualSpawn = ManualSpawn;
295 				return this;
296 			}
297 		
298 	        /**
299 	        
300 			Enables/disables auto ray tracing feature.
301 		 
302 	        */
303 	        protected
304 	         Boolean AutoTrace =
305 	       	
306 	        		null
307 	        	;
308 	
309 	        
310 	        
311  		/**
312          * 
313 			Enables/disables auto ray tracing feature.
314 		 
315          */
316         public Boolean isAutoTrace()
317  	
318 	        {
319 	            return
320 	        	 AutoTrace;
321 	        }
322 	        
323 	        
324 	        
325  		
326  		/**
327          * 
328 			Enables/disables auto ray tracing feature.
329 		 
330          */
331         public Initialize 
332         setAutoTrace(Boolean AutoTrace)
333  	
334 			{
335 				this.AutoTrace = AutoTrace;
336 				return this;
337 			}
338 		
339 	        /**
340 	        
341 			Specify start location, if unspecified, then random.
342 		 
343 	        */
344 	        protected
345 	         Location Location =
346 	       	
347 	        		null
348 	        	;
349 	
350 	        
351 	        
352  		/**
353          * 
354 			Specify start location, if unspecified, then random.
355 		 
356          */
357         public Location getLocation()
358  	
359 	        {
360 	            return
361 	        	 Location;
362 	        }
363 	        
364 	        
365 	        
366  		
367  		/**
368          * 
369 			Specify start location, if unspecified, then random.
370 		 
371          */
372         public Initialize 
373         setLocation(Location Location)
374  	
375 			{
376 				this.Location = Location;
377 				return this;
378 			}
379 		
380 	        /**
381 	        
382 			Specify start rotation, if unspecified, then random.
383 		 
384 	        */
385 	        protected
386 	         Rotation Rotation =
387 	       	
388 	        		null
389 	        	;
390 	
391 	        
392 	        
393  		/**
394          * 
395 			Specify start rotation, if unspecified, then random.
396 		 
397          */
398         public Rotation getRotation()
399  	
400 	        {
401 	            return
402 	        	 Rotation;
403 	        }
404 	        
405 	        
406 	        
407  		
408  		/**
409          * 
410 			Specify start rotation, if unspecified, then random.
411 		 
412          */
413         public Initialize 
414         setRotation(Rotation Rotation)
415  	
416 			{
417 				this.Rotation = Rotation;
418 				return this;
419 			}
420 		
421 	        /**
422 	        
423 			Sets the bot current skin (e.g. "HumanMaleA.MercMaleA").
424 			Find all packages and skins through unrealEd (Actor browser,
425 			search in UT2004/Animations folder). Supported bot skins are
426 			Aliens (Aliens.), Bots (Bot.), human males (HumanMaleA.),
427 			human females (HumanFemaleA. ), juggernauts (Jugg.). Skaarj
428 			skins are not supported at the time being.
429 		 
430 	        */
431 	        protected
432 	         String Skin =
433 	       	
434 	        		null
435 	        	;
436 	
437 	        
438 	        
439  		/**
440          * 
441 			Sets the bot current skin (e.g. "HumanMaleA.MercMaleA").
442 			Find all packages and skins through unrealEd (Actor browser,
443 			search in UT2004/Animations folder). Supported bot skins are
444 			Aliens (Aliens.), Bots (Bot.), human males (HumanMaleA.),
445 			human females (HumanFemaleA. ), juggernauts (Jugg.). Skaarj
446 			skins are not supported at the time being.
447 		 
448          */
449         public String getSkin()
450  	
451 	        {
452 	            return
453 	        	 Skin;
454 	        }
455 	        
456 	        
457 	        
458  		
459  		/**
460          * 
461 			Sets the bot current skin (e.g. "HumanMaleA.MercMaleA").
462 			Find all packages and skins through unrealEd (Actor browser,
463 			search in UT2004/Animations folder). Supported bot skins are
464 			Aliens (Aliens.), Bots (Bot.), human males (HumanMaleA.),
465 			human females (HumanFemaleA. ), juggernauts (Jugg.). Skaarj
466 			skins are not supported at the time being.
467 		 
468          */
469         public Initialize 
470         setSkin(String Skin)
471  	
472 			{
473 				this.Skin = Skin;
474 				return this;
475 			}
476 		
477 	        /**
478 	        
479 			Can range from 0 to 7. This sets the bot accuracy. 1 lowest,
480 			7 highest. Shouldn't have any other effect.
481 		 
482 	        */
483 	        protected
484 	         Integer DesiredSkill =
485 	       	
486 	        		null
487 	        	;
488 	
489 	        
490 	        
491  		/**
492          * 
493 			Can range from 0 to 7. This sets the bot accuracy. 1 lowest,
494 			7 highest. Shouldn't have any other effect.
495 		 
496          */
497         public Integer getDesiredSkill()
498  	
499 	        {
500 	            return
501 	        	 DesiredSkill;
502 	        }
503 	        
504 	        
505 	        
506  		
507  		/**
508          * 
509 			Can range from 0 to 7. This sets the bot accuracy. 1 lowest,
510 			7 highest. Shouldn't have any other effect.
511 		 
512          */
513         public Initialize 
514         setDesiredSkill(Integer DesiredSkill)
515  	
516 			{
517 				this.DesiredSkill = DesiredSkill;
518 				return this;
519 			}
520 		
521 	        /**
522 	        
523 			When firing slow projectiles (missiles...), if the engine
524 			will try to count the impact point for the bot or not (when
525 			shooting at moving targets).
526 		 
527 	        */
528 	        protected
529 	         Boolean ShouldLeadTarget =
530 	       	
531 	        		null
532 	        	;
533 	
534 	        
535 	        
536  		/**
537          * 
538 			When firing slow projectiles (missiles...), if the engine
539 			will try to count the impact point for the bot or not (when
540 			shooting at moving targets).
541 		 
542          */
543         public Boolean isShouldLeadTarget()
544  	
545 	        {
546 	            return
547 	        	 ShouldLeadTarget;
548 	        }
549 	        
550 	        
551 	        
552  		
553  		/**
554          * 
555 			When firing slow projectiles (missiles...), if the engine
556 			will try to count the impact point for the bot or not (when
557 			shooting at moving targets).
558 		 
559          */
560         public Initialize 
561         setShouldLeadTarget(Boolean ShouldLeadTarget)
562  	
563 			{
564 				this.ShouldLeadTarget = ShouldLeadTarget;
565 				return this;
566 			}
567 		
568 	        /**
569 	        
570 			It enables/disables automatic pickup of the bot. If true the items can be picked up through PICK command.
571 		 
572 	        */
573 	        protected
574 	         Boolean AutoPickupOff =
575 	       	
576 	        		null
577 	        	;
578 	
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          */
586         public Boolean isAutoPickupOff()
587  	
588 	        {
589 	            return
590 	        	 AutoPickupOff;
591 	        }
592 	        
593 	        
594 	        
595  		
596  		/**
597          * 
598 			It enables/disables automatic pickup of the bot. If true the items can be picked up through PICK command.
599 		 
600          */
601         public Initialize 
602         setAutoPickupOff(Boolean AutoPickupOff)
603  	
604 			{
605 				this.AutoPickupOff = AutoPickupOff;
606 				return this;
607 			}
608 		
609 	        /**
610 	        
611 			Sets the jmx adress we can use to debug the bot from Java (if we are using Pogamut).
612 		 
613 	        */
614 	        protected
615 	         String Jmx =
616 	       	
617 	        		null
618 	        	;
619 	
620 	        
621 	        
622  		/**
623          * 
624 			Sets the jmx adress we can use to debug the bot from Java (if we are using Pogamut).
625 		 
626          */
627         public String getJmx()
628  	
629 	        {
630 	            return
631 	        	 Jmx;
632 	        }
633 	        
634 	        
635 	        
636  		
637  		/**
638          * 
639 			Sets the jmx adress we can use to debug the bot from Java (if we are using Pogamut).
640 		 
641          */
642         public Initialize 
643         setJmx(String Jmx)
644  	
645 			{
646 				this.Jmx = Jmx;
647 				return this;
648 			}
649 		
650 	        /**
651 	        
652 			Sets the Unreal Tournament class of the bot that should be used. By default leave it blank. In UnrealRuntime2 it may be used to spawn bots of different class.
653 		 
654 	        */
655 	        protected
656 	         String ClassName =
657 	       	
658 	        		null
659 	        	;
660 	
661 	        
662 	        
663  		/**
664          * 
665 			Sets the Unreal Tournament class of the bot that should be used. By default leave it blank. In UnrealRuntime2 it may be used to spawn bots of different class.
666 		 
667          */
668         public String getClassName()
669  	
670 	        {
671 	            return
672 	        	 ClassName;
673 	        }
674 	        
675 	        
676 	        
677  		
678  		/**
679          * 
680 			Sets the Unreal Tournament class of the bot that should be used. By default leave it blank. In UnrealRuntime2 it may be used to spawn bots of different class.
681 		 
682          */
683         public Initialize 
684         setClassName(String ClassName)
685  	
686 			{
687 				this.ClassName = ClassName;
688 				return this;
689 			}
690 		
691  	    public String toString() {
692             return toMessage();
693         }
694  	
695  		public String toHtmlString() {
696 			return super.toString() + "[<br/>" +
697             	
698             	"<b>Name</b> = " +
699             	String.valueOf(getName()
700  	) +
701             	" <br/> " +
702             	
703             	"<b>Team</b> = " +
704             	String.valueOf(getTeam()
705  	) +
706             	" <br/> " +
707             	
708             	"<b>ManualSpawn</b> = " +
709             	String.valueOf(isManualSpawn()
710  	) +
711             	" <br/> " +
712             	
713             	"<b>AutoTrace</b> = " +
714             	String.valueOf(isAutoTrace()
715  	) +
716             	" <br/> " +
717             	
718             	"<b>Location</b> = " +
719             	String.valueOf(getLocation()
720  	) +
721             	" <br/> " +
722             	
723             	"<b>Rotation</b> = " +
724             	String.valueOf(getRotation()
725  	) +
726             	" <br/> " +
727             	
728             	"<b>Skin</b> = " +
729             	String.valueOf(getSkin()
730  	) +
731             	" <br/> " +
732             	
733             	"<b>DesiredSkill</b> = " +
734             	String.valueOf(getDesiredSkill()
735  	) +
736             	" <br/> " +
737             	
738             	"<b>ShouldLeadTarget</b> = " +
739             	String.valueOf(isShouldLeadTarget()
740  	) +
741             	" <br/> " +
742             	
743             	"<b>AutoPickupOff</b> = " +
744             	String.valueOf(isAutoPickupOff()
745  	) +
746             	" <br/> " +
747             	
748             	"<b>Jmx</b> = " +
749             	String.valueOf(getJmx()
750  	) +
751             	" <br/> " +
752             	
753             	"<b>ClassName</b> = " +
754             	String.valueOf(getClassName()
755  	) +
756             	" <br/> " +
757             	 
758             	"<br/>]"
759             ;
760 		}
761  	
762 		public String toMessage() {
763      		StringBuffer buf = new StringBuffer();
764      		buf.append("INIT");
765      		
766 						if (Name != null) {
767 							buf.append(" {Name " + Name + "}");
768 						}
769 					
770 						if (Team != null) {
771 							buf.append(" {Team " + Team + "}");
772 						}
773 					
774 						if (ManualSpawn != null) {
775 							buf.append(" {ManualSpawn " + ManualSpawn + "}");
776 						}
777 					
778 						if (AutoTrace != null) {
779 							buf.append(" {AutoTrace " + AutoTrace + "}");
780 						}
781 					
782 					    if (Location != null) {
783 					        buf.append(" {Location " +
784 					            Location.getX() + "," +
785 					            Location.getY() + "," +
786 					            Location.getZ() + "}");
787 					    }
788 					
789 					    if (Rotation != null) {
790 					        buf.append(" {Rotation " +
791 					            Rotation.getPitch() + "," +
792 					            Rotation.getYaw() + "," +
793 					            Rotation.getRoll() + "}");
794 					    }
795 					
796 						if (Skin != null) {
797 							buf.append(" {Skin " + Skin + "}");
798 						}
799 					
800 						if (DesiredSkill != null) {
801 							buf.append(" {DesiredSkill " + DesiredSkill + "}");
802 						}
803 					
804 						if (ShouldLeadTarget != null) {
805 							buf.append(" {ShouldLeadTarget " + ShouldLeadTarget + "}");
806 						}
807 					
808 						if (AutoPickupOff != null) {
809 							buf.append(" {AutoPickupOff " + AutoPickupOff + "}");
810 						}
811 					
812 						if (Jmx != null) {
813 							buf.append(" {Jmx " + Jmx + "}");
814 						}
815 					
816 						if (ClassName != null) {
817 							buf.append(" {ClassName " + ClassName + "}");
818 						}
819 					
820    			return buf.toString();
821    		}
822  	
823  		// --- Extra Java from XML BEGIN (extra/code/java)
824         	
825 		// --- Extra Java from XML END (extra/code/java)
826  	
827 	        }
828