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 SENDCTRLMSG.
15   		 *
16   		 * 
17  		Send a message to the all bots or just one bot. To be used for "protocol within protocol", not perfect, but suffices for now.
18  	
19           */
20   	public class SendControlMessage 
21  		extends CommandMessage
22  	        {
23  	        	
24  		        
25      	/** Example how the message looks like - used during parser tests. */
26      	public static final String PROTOTYPE =
27      		" {SendAll False}  {BotId unreal_id}  {Type text}  {PS1 text}  {PS2 text}  {PS3 text}  {PI1 0}  {PI2 0}  {PI3 0}  {PF1 0}  {PF2 0}  {PF3 0}  {PB1 False}  {PB2 False}  {PB3 False} ";
28      
29  		/**
30  		 * Creates new instance of command SendControlMessage.
31  		 * 
32  		Send a message to the all bots or just one bot. To be used for "protocol within protocol", not perfect, but suffices for now.
33  	
34  		 * Corresponding GameBots message for this command is
35  		 * SENDCTRLMSG.
36  		 *
37  		 * 
38  		 *    @param SendAll True - sends the message to ALL connected bots, False - sends to one bot specified within BotId.
39  		 *    @param BotId Only valid for SendAll='false', here you can specify Id of the bot that should receive the message.
40  		 *    @param Type Custom type of the message.
41  		 *    @param PS1 Param String 1
42  		 *    @param PS2 Param String 2
43  		 *    @param PS3 Param String 3
44  		 *    @param PI1 Param Integer 1
45  		 *    @param PI2 Param Integer 2
46  		 *    @param PI3 Param Integer 3
47  		 *    @param PF1 Param Double 1
48  		 *    @param PF2 Param Double 2
49  		 *    @param PF3 Param Double 3
50  		 *    @param PB1 Param Boolean 1
51  		 *    @param PB2 Param Boolean 2
52  		 *    @param PB3 Param Boolean 3
53  		 */
54  		public SendControlMessage(
55  			Boolean SendAll,  UnrealId BotId,  String Type,  String PS1,  String PS2,  String PS3,  Integer PI1,  Integer PI2,  Integer PI3,  Double PF1,  Double PF2,  Double PF3,  Boolean PB1,  Boolean PB2,  Boolean PB3
56  		) {
57  			
58  				this.SendAll = SendAll;
59              
60  				this.BotId = BotId;
61              
62  				this.Type = Type;
63              
64  				this.PS1 = PS1;
65              
66  				this.PS2 = PS2;
67              
68  				this.PS3 = PS3;
69              
70  				this.PI1 = PI1;
71              
72  				this.PI2 = PI2;
73              
74  				this.PI3 = PI3;
75              
76  				this.PF1 = PF1;
77              
78  				this.PF2 = PF2;
79              
80  				this.PF3 = PF3;
81              
82  				this.PB1 = PB1;
83              
84  				this.PB2 = PB2;
85              
86  				this.PB3 = PB3;
87              
88  		}
89  
90  		
91  			/**
92  			 * Creates new instance of command SendControlMessage.
93  			 * 
94  		Send a message to the all bots or just one bot. To be used for "protocol within protocol", not perfect, but suffices for now.
95  	
96  			 * Corresponding GameBots message for this command is
97  			 * SENDCTRLMSG.
98  			 * <p></p>
99  			 * WARNING: this is empty-command constructor, you have to use setters to fill it up with data that should be sent to GameBots2004!
100 		     */
101 		    public SendControlMessage() {
102 		    }
103 			
104 		
105 		/**
106 		 * Cloning constructor.
107 		 *
108 		 * @param original
109 		 */
110 		public SendControlMessage(SendControlMessage original) {
111 		   
112 		        this.SendAll = original.SendAll;
113 		   
114 		        this.BotId = original.BotId;
115 		   
116 		        this.Type = original.Type;
117 		   
118 		        this.PS1 = original.PS1;
119 		   
120 		        this.PS2 = original.PS2;
121 		   
122 		        this.PS3 = original.PS3;
123 		   
124 		        this.PI1 = original.PI1;
125 		   
126 		        this.PI2 = original.PI2;
127 		   
128 		        this.PI3 = original.PI3;
129 		   
130 		        this.PF1 = original.PF1;
131 		   
132 		        this.PF2 = original.PF2;
133 		   
134 		        this.PF3 = original.PF3;
135 		   
136 		        this.PB1 = original.PB1;
137 		   
138 		        this.PB2 = original.PB2;
139 		   
140 		        this.PB3 = original.PB3;
141 		   
142 		}
143     
144 	        /**
145 	        True - sends the message to ALL connected bots, False - sends to one bot specified within BotId. 
146 	        */
147 	        protected
148 	         Boolean SendAll =
149 	       	
150 	        		null
151 	        	;
152 	
153 	        
154 	        
155  		/**
156          * True - sends the message to ALL connected bots, False - sends to one bot specified within BotId. 
157          */
158         public Boolean isSendAll()
159  	
160 	        {
161 	            return
162 	        	 SendAll;
163 	        }
164 	        
165 	        
166 	        
167  		
168  		/**
169          * True - sends the message to ALL connected bots, False - sends to one bot specified within BotId. 
170          */
171         public SendControlMessage 
172         setSendAll(Boolean SendAll)
173  	
174 			{
175 				this.SendAll = SendAll;
176 				return this;
177 			}
178 		
179 	        /**
180 	        Only valid for SendAll='false', here you can specify Id of the bot that should receive the message. 
181 	        */
182 	        protected
183 	         UnrealId BotId =
184 	       	
185 	        		null
186 	        	;
187 	
188 	        
189 	        
190  		/**
191          * Only valid for SendAll='false', here you can specify Id of the bot that should receive the message. 
192          */
193         public UnrealId getBotId()
194  	
195 	        {
196 	            return
197 	        	 BotId;
198 	        }
199 	        
200 	        
201 	        
202  		
203  		/**
204          * Only valid for SendAll='false', here you can specify Id of the bot that should receive the message. 
205          */
206         public SendControlMessage 
207         setBotId(UnrealId BotId)
208  	
209 			{
210 				this.BotId = BotId;
211 				return this;
212 			}
213 		
214 	        /**
215 	        Custom type of the message. 
216 	        */
217 	        protected
218 	         String Type =
219 	       	
220 	        		null
221 	        	;
222 	
223 	        
224 	        
225  		/**
226          * Custom type of the message. 
227          */
228         public String getType()
229  	
230 	        {
231 	            return
232 	        	 Type;
233 	        }
234 	        
235 	        
236 	        
237  		
238  		/**
239          * Custom type of the message. 
240          */
241         public SendControlMessage 
242         setType(String Type)
243  	
244 			{
245 				this.Type = Type;
246 				return this;
247 			}
248 		
249 	        /**
250 	        Param String 1 
251 	        */
252 	        protected
253 	         String PS1 =
254 	       	
255 	        		null
256 	        	;
257 	
258 	        
259 	        
260  		/**
261          * Param String 1 
262          */
263         public String getPS1()
264  	
265 	        {
266 	            return
267 	        	 PS1;
268 	        }
269 	        
270 	        
271 	        
272  		
273  		/**
274          * Param String 1 
275          */
276         public SendControlMessage 
277         setPS1(String PS1)
278  	
279 			{
280 				this.PS1 = PS1;
281 				return this;
282 			}
283 		
284 	        /**
285 	        Param String 2 
286 	        */
287 	        protected
288 	         String PS2 =
289 	       	
290 	        		null
291 	        	;
292 	
293 	        
294 	        
295  		/**
296          * Param String 2 
297          */
298         public String getPS2()
299  	
300 	        {
301 	            return
302 	        	 PS2;
303 	        }
304 	        
305 	        
306 	        
307  		
308  		/**
309          * Param String 2 
310          */
311         public SendControlMessage 
312         setPS2(String PS2)
313  	
314 			{
315 				this.PS2 = PS2;
316 				return this;
317 			}
318 		
319 	        /**
320 	        Param String 3 
321 	        */
322 	        protected
323 	         String PS3 =
324 	       	
325 	        		null
326 	        	;
327 	
328 	        
329 	        
330  		/**
331          * Param String 3 
332          */
333         public String getPS3()
334  	
335 	        {
336 	            return
337 	        	 PS3;
338 	        }
339 	        
340 	        
341 	        
342  		
343  		/**
344          * Param String 3 
345          */
346         public SendControlMessage 
347         setPS3(String PS3)
348  	
349 			{
350 				this.PS3 = PS3;
351 				return this;
352 			}
353 		
354 	        /**
355 	        Param Integer 1 
356 	        */
357 	        protected
358 	         Integer PI1 =
359 	       	
360 	        		null
361 	        	;
362 	
363 	        
364 	        
365  		/**
366          * Param Integer 1 
367          */
368         public Integer getPI1()
369  	
370 	        {
371 	            return
372 	        	 PI1;
373 	        }
374 	        
375 	        
376 	        
377  		
378  		/**
379          * Param Integer 1 
380          */
381         public SendControlMessage 
382         setPI1(Integer PI1)
383  	
384 			{
385 				this.PI1 = PI1;
386 				return this;
387 			}
388 		
389 	        /**
390 	        Param Integer 2 
391 	        */
392 	        protected
393 	         Integer PI2 =
394 	       	
395 	        		null
396 	        	;
397 	
398 	        
399 	        
400  		/**
401          * Param Integer 2 
402          */
403         public Integer getPI2()
404  	
405 	        {
406 	            return
407 	        	 PI2;
408 	        }
409 	        
410 	        
411 	        
412  		
413  		/**
414          * Param Integer 2 
415          */
416         public SendControlMessage 
417         setPI2(Integer PI2)
418  	
419 			{
420 				this.PI2 = PI2;
421 				return this;
422 			}
423 		
424 	        /**
425 	        Param Integer 3 
426 	        */
427 	        protected
428 	         Integer PI3 =
429 	       	
430 	        		null
431 	        	;
432 	
433 	        
434 	        
435  		/**
436          * Param Integer 3 
437          */
438         public Integer getPI3()
439  	
440 	        {
441 	            return
442 	        	 PI3;
443 	        }
444 	        
445 	        
446 	        
447  		
448  		/**
449          * Param Integer 3 
450          */
451         public SendControlMessage 
452         setPI3(Integer PI3)
453  	
454 			{
455 				this.PI3 = PI3;
456 				return this;
457 			}
458 		
459 	        /**
460 	        Param Double 1 
461 	        */
462 	        protected
463 	         Double PF1 =
464 	       	
465 	        		null
466 	        	;
467 	
468 	        
469 	        
470  		/**
471          * Param Double 1 
472          */
473         public Double getPF1()
474  	
475 	        {
476 	            return
477 	        	 PF1;
478 	        }
479 	        
480 	        
481 	        
482  		
483  		/**
484          * Param Double 1 
485          */
486         public SendControlMessage 
487         setPF1(Double PF1)
488  	
489 			{
490 				this.PF1 = PF1;
491 				return this;
492 			}
493 		
494 	        /**
495 	        Param Double 2 
496 	        */
497 	        protected
498 	         Double PF2 =
499 	       	
500 	        		null
501 	        	;
502 	
503 	        
504 	        
505  		/**
506          * Param Double 2 
507          */
508         public Double getPF2()
509  	
510 	        {
511 	            return
512 	        	 PF2;
513 	        }
514 	        
515 	        
516 	        
517  		
518  		/**
519          * Param Double 2 
520          */
521         public SendControlMessage 
522         setPF2(Double PF2)
523  	
524 			{
525 				this.PF2 = PF2;
526 				return this;
527 			}
528 		
529 	        /**
530 	        Param Double 3 
531 	        */
532 	        protected
533 	         Double PF3 =
534 	       	
535 	        		null
536 	        	;
537 	
538 	        
539 	        
540  		/**
541          * Param Double 3 
542          */
543         public Double getPF3()
544  	
545 	        {
546 	            return
547 	        	 PF3;
548 	        }
549 	        
550 	        
551 	        
552  		
553  		/**
554          * Param Double 3 
555          */
556         public SendControlMessage 
557         setPF3(Double PF3)
558  	
559 			{
560 				this.PF3 = PF3;
561 				return this;
562 			}
563 		
564 	        /**
565 	        Param Boolean 1 
566 	        */
567 	        protected
568 	         Boolean PB1 =
569 	       	
570 	        		null
571 	        	;
572 	
573 	        
574 	        
575  		/**
576          * Param Boolean 1 
577          */
578         public Boolean isPB1()
579  	
580 	        {
581 	            return
582 	        	 PB1;
583 	        }
584 	        
585 	        
586 	        
587  		
588  		/**
589          * Param Boolean 1 
590          */
591         public SendControlMessage 
592         setPB1(Boolean PB1)
593  	
594 			{
595 				this.PB1 = PB1;
596 				return this;
597 			}
598 		
599 	        /**
600 	        Param Boolean 2 
601 	        */
602 	        protected
603 	         Boolean PB2 =
604 	       	
605 	        		null
606 	        	;
607 	
608 	        
609 	        
610  		/**
611          * Param Boolean 2 
612          */
613         public Boolean isPB2()
614  	
615 	        {
616 	            return
617 	        	 PB2;
618 	        }
619 	        
620 	        
621 	        
622  		
623  		/**
624          * Param Boolean 2 
625          */
626         public SendControlMessage 
627         setPB2(Boolean PB2)
628  	
629 			{
630 				this.PB2 = PB2;
631 				return this;
632 			}
633 		
634 	        /**
635 	        Param Boolean 3 
636 	        */
637 	        protected
638 	         Boolean PB3 =
639 	       	
640 	        		null
641 	        	;
642 	
643 	        
644 	        
645  		/**
646          * Param Boolean 3 
647          */
648         public Boolean isPB3()
649  	
650 	        {
651 	            return
652 	        	 PB3;
653 	        }
654 	        
655 	        
656 	        
657  		
658  		/**
659          * Param Boolean 3 
660          */
661         public SendControlMessage 
662         setPB3(Boolean PB3)
663  	
664 			{
665 				this.PB3 = PB3;
666 				return this;
667 			}
668 		
669  	    public String toString() {
670             return toMessage();
671         }
672  	
673  		public String toHtmlString() {
674 			return super.toString() + "[<br/>" +
675             	
676             	"<b>SendAll</b> = " +
677             	String.valueOf(isSendAll()
678  	) +
679             	" <br/> " +
680             	
681             	"<b>BotId</b> = " +
682             	String.valueOf(getBotId()
683  	) +
684             	" <br/> " +
685             	
686             	"<b>Type</b> = " +
687             	String.valueOf(getType()
688  	) +
689             	" <br/> " +
690             	
691             	"<b>PS1</b> = " +
692             	String.valueOf(getPS1()
693  	) +
694             	" <br/> " +
695             	
696             	"<b>PS2</b> = " +
697             	String.valueOf(getPS2()
698  	) +
699             	" <br/> " +
700             	
701             	"<b>PS3</b> = " +
702             	String.valueOf(getPS3()
703  	) +
704             	" <br/> " +
705             	
706             	"<b>PI1</b> = " +
707             	String.valueOf(getPI1()
708  	) +
709             	" <br/> " +
710             	
711             	"<b>PI2</b> = " +
712             	String.valueOf(getPI2()
713  	) +
714             	" <br/> " +
715             	
716             	"<b>PI3</b> = " +
717             	String.valueOf(getPI3()
718  	) +
719             	" <br/> " +
720             	
721             	"<b>PF1</b> = " +
722             	String.valueOf(getPF1()
723  	) +
724             	" <br/> " +
725             	
726             	"<b>PF2</b> = " +
727             	String.valueOf(getPF2()
728  	) +
729             	" <br/> " +
730             	
731             	"<b>PF3</b> = " +
732             	String.valueOf(getPF3()
733  	) +
734             	" <br/> " +
735             	
736             	"<b>PB1</b> = " +
737             	String.valueOf(isPB1()
738  	) +
739             	" <br/> " +
740             	
741             	"<b>PB2</b> = " +
742             	String.valueOf(isPB2()
743  	) +
744             	" <br/> " +
745             	
746             	"<b>PB3</b> = " +
747             	String.valueOf(isPB3()
748  	) +
749             	" <br/> " +
750             	 
751             	"<br/>]"
752             ;
753 		}
754  	
755 		public String toMessage() {
756      		StringBuffer buf = new StringBuffer();
757      		buf.append("SENDCTRLMSG");
758      		
759 						if (SendAll != null) {
760 							buf.append(" {SendAll " + SendAll + "}");
761 						}
762 					
763 						if (BotId != null) {
764 							buf.append(" {BotId " + BotId.getStringId() + "}");
765 						}
766 					
767 						if (Type != null) {
768 							buf.append(" {Type " + Type + "}");
769 						}
770 					
771 						if (PS1 != null) {
772 							buf.append(" {PS1 " + PS1 + "}");
773 						}
774 					
775 						if (PS2 != null) {
776 							buf.append(" {PS2 " + PS2 + "}");
777 						}
778 					
779 						if (PS3 != null) {
780 							buf.append(" {PS3 " + PS3 + "}");
781 						}
782 					
783 						if (PI1 != null) {
784 							buf.append(" {PI1 " + PI1 + "}");
785 						}
786 					
787 						if (PI2 != null) {
788 							buf.append(" {PI2 " + PI2 + "}");
789 						}
790 					
791 						if (PI3 != null) {
792 							buf.append(" {PI3 " + PI3 + "}");
793 						}
794 					
795 						if (PF1 != null) {
796 							buf.append(" {PF1 " + PF1 + "}");
797 						}
798 					
799 						if (PF2 != null) {
800 							buf.append(" {PF2 " + PF2 + "}");
801 						}
802 					
803 						if (PF3 != null) {
804 							buf.append(" {PF3 " + PF3 + "}");
805 						}
806 					
807 						if (PB1 != null) {
808 							buf.append(" {PB1 " + PB1 + "}");
809 						}
810 					
811 						if (PB2 != null) {
812 							buf.append(" {PB2 " + PB2 + "}");
813 						}
814 					
815 						if (PB3 != null) {
816 							buf.append(" {PB3 " + PB3 + "}");
817 						}
818 					
819    			return buf.toString();
820    		}
821  	
822  		// --- Extra Java from XML BEGIN (extra/code/java)
823         	
824 		// --- Extra Java from XML END (extra/code/java)
825  	
826 	        }
827