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