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