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 SETEMIT.
15   		 *
16   		 * 
17  		Sets the emotional emitter for the bot and configures it. The emitter will float
18          at the bots head following the bot.
19  	
20           */
21   	public class SetEmotionalEmitter 
22  		extends CommandMessage
23  	        {
24  	        	
25  		        
26      	/** Example how the message looks like - used during parser tests. */
27      	public static final String PROTOTYPE =
28      		" {Disable False}  {Pause False}  {FirstC 0,0,0}  {SecondC 0,0,0}  {StartVelocity 0,0,0}  {EndVelocity 0,0,0}  {VelocityRange 0}  {Size 0,0,0}  {LifeTime 0}  {FadeTime 0,0,0} ";
29      
30  		/**
31  		 * Creates new instance of command SetEmotionalEmitter.
32  		 * 
33  		Sets the emotional emitter for the bot and configures it. The emitter will float
34          at the bots head following the bot.
35  	
36  		 * Corresponding GameBots message for this command is
37  		 * SETEMIT.
38  		 *
39  		 * 
40  		 *    @param Disable 
41              If true disables actual emittor (it will dissappear). No other attributes will be parsed.
42          
43  		 *    @param Pause 
44              Should pause the emitter, does not work right now.
45          
46  		 *    @param FirstC 
47              Starting color of the floating balls.
48          
49  		 *    @param SecondC 
50  			Finishing color of the floating balls.
51  		
52  		 *    @param StartVelocity 
53  			This is relative velocity direction vector that will affect the speed and direction of the balls
54              going out. Default (2,2,2).
55  		
56  		 *    @param EndVelocity 
57  			This is relative velocity direction vector that will affect the speed and direction of the balls
58              going in. Default (-10,-10,-10).
59  		
60  		 *    @param VelocityRange 
61  			This will affect the speed of the balls. Default -20.
62  		
63  		 *    @param Size 
64  			This will affect the size of the balls. Default (4,4,8).
65  		
66  		 *    @param LifeTime 
67  			This will affect the life time of the balls and radius and speed they will
68              be traversing. Default 1.6.
69  		
70  		 *    @param FadeTime 
71  			This will affect the fade in and fade out times of the balls. First value affects
72              the starting fade out time. Second value will affect ending fade in time. The third
73              value in the vector is ignored.
74  		
75  		 */
76  		public SetEmotionalEmitter(
77  			Boolean Disable,  Boolean Pause,  Vector3d FirstC,  Vector3d SecondC,  Velocity StartVelocity,  Velocity EndVelocity,  Double VelocityRange,  Vector3d Size,  Double LifeTime,  Vector3d FadeTime
78  		) {
79  			
80  				this.Disable = Disable;
81              
82  				this.Pause = Pause;
83              
84  				this.FirstC = FirstC;
85              
86  				this.SecondC = SecondC;
87              
88  				this.StartVelocity = StartVelocity;
89              
90  				this.EndVelocity = EndVelocity;
91              
92  				this.VelocityRange = VelocityRange;
93              
94  				this.Size = Size;
95              
96  				this.LifeTime = LifeTime;
97              
98  				this.FadeTime = FadeTime;
99              
100 		}
101 
102 		
103 			/**
104 			 * Creates new instance of command SetEmotionalEmitter.
105 			 * 
106 		Sets the emotional emitter for the bot and configures it. The emitter will float
107         at the bots head following the bot.
108 	
109 			 * Corresponding GameBots message for this command is
110 			 * SETEMIT.
111 			 * <p></p>
112 			 * WARNING: this is empty-command constructor, you have to use setters to fill it up with data that should be sent to GameBots2004!
113 		     */
114 		    public SetEmotionalEmitter() {
115 		    }
116 			
117 		
118 		/**
119 		 * Cloning constructor.
120 		 *
121 		 * @param original
122 		 */
123 		public SetEmotionalEmitter(SetEmotionalEmitter original) {
124 		   
125 		        this.Disable = original.Disable;
126 		   
127 		        this.Pause = original.Pause;
128 		   
129 		        this.FirstC = original.FirstC;
130 		   
131 		        this.SecondC = original.SecondC;
132 		   
133 		        this.StartVelocity = original.StartVelocity;
134 		   
135 		        this.EndVelocity = original.EndVelocity;
136 		   
137 		        this.VelocityRange = original.VelocityRange;
138 		   
139 		        this.Size = original.Size;
140 		   
141 		        this.LifeTime = original.LifeTime;
142 		   
143 		        this.FadeTime = original.FadeTime;
144 		   
145 		}
146     
147 	        /**
148 	        
149             If true disables actual emittor (it will dissappear). No other attributes will be parsed.
150          
151 	        */
152 	        protected
153 	         Boolean Disable =
154 	       	
155 	        		null
156 	        	;
157 	
158 	        
159 	        
160  		/**
161          * 
162             If true disables actual emittor (it will dissappear). No other attributes will be parsed.
163          
164          */
165         public Boolean isDisable()
166  	
167 	        {
168 	            return
169 	        	 Disable;
170 	        }
171 	        
172 	        
173 	        
174  		
175  		/**
176          * 
177             If true disables actual emittor (it will dissappear). No other attributes will be parsed.
178          
179          */
180         public SetEmotionalEmitter 
181         setDisable(Boolean Disable)
182  	
183 			{
184 				this.Disable = Disable;
185 				return this;
186 			}
187 		
188 	        /**
189 	        
190             Should pause the emitter, does not work right now.
191          
192 	        */
193 	        protected
194 	         Boolean Pause =
195 	       	
196 	        		null
197 	        	;
198 	
199 	        
200 	        
201  		/**
202          * 
203             Should pause the emitter, does not work right now.
204          
205          */
206         public Boolean isPause()
207  	
208 	        {
209 	            return
210 	        	 Pause;
211 	        }
212 	        
213 	        
214 	        
215  		
216  		/**
217          * 
218             Should pause the emitter, does not work right now.
219          
220          */
221         public SetEmotionalEmitter 
222         setPause(Boolean Pause)
223  	
224 			{
225 				this.Pause = Pause;
226 				return this;
227 			}
228 		
229 	        /**
230 	        
231             Starting color of the floating balls.
232          
233 	        */
234 	        protected
235 	         Vector3d FirstC =
236 	       	
237 	        		null
238 	        	;
239 	
240 	        
241 	        
242  		/**
243          * 
244             Starting color of the floating balls.
245          
246          */
247         public Vector3d getFirstC()
248  	
249 	        {
250 	            return
251 	        	 FirstC;
252 	        }
253 	        
254 	        
255 	        
256  		
257  		/**
258          * 
259             Starting color of the floating balls.
260          
261          */
262         public SetEmotionalEmitter 
263         setFirstC(Vector3d FirstC)
264  	
265 			{
266 				this.FirstC = FirstC;
267 				return this;
268 			}
269 		
270 	        /**
271 	        
272 			Finishing color of the floating balls.
273 		 
274 	        */
275 	        protected
276 	         Vector3d SecondC =
277 	       	
278 	        		null
279 	        	;
280 	
281 	        
282 	        
283  		/**
284          * 
285 			Finishing color of the floating balls.
286 		 
287          */
288         public Vector3d getSecondC()
289  	
290 	        {
291 	            return
292 	        	 SecondC;
293 	        }
294 	        
295 	        
296 	        
297  		
298  		/**
299          * 
300 			Finishing color of the floating balls.
301 		 
302          */
303         public SetEmotionalEmitter 
304         setSecondC(Vector3d SecondC)
305  	
306 			{
307 				this.SecondC = SecondC;
308 				return this;
309 			}
310 		
311 	        /**
312 	        
313 			This is relative velocity direction vector that will affect the speed and direction of the balls
314             going out. Default (2,2,2).
315 		 
316 	        */
317 	        protected
318 	         Velocity StartVelocity =
319 	       	
320 	        		null
321 	        	;
322 	
323 	        
324 	        
325  		/**
326          * 
327 			This is relative velocity direction vector that will affect the speed and direction of the balls
328             going out. Default (2,2,2).
329 		 
330          */
331         public Velocity getStartVelocity()
332  	
333 	        {
334 	            return
335 	        	 StartVelocity;
336 	        }
337 	        
338 	        
339 	        
340  		
341  		/**
342          * 
343 			This is relative velocity direction vector that will affect the speed and direction of the balls
344             going out. Default (2,2,2).
345 		 
346          */
347         public SetEmotionalEmitter 
348         setStartVelocity(Velocity StartVelocity)
349  	
350 			{
351 				this.StartVelocity = StartVelocity;
352 				return this;
353 			}
354 		
355 	        /**
356 	        
357 			This is relative velocity direction vector that will affect the speed and direction of the balls
358             going in. Default (-10,-10,-10).
359 		 
360 	        */
361 	        protected
362 	         Velocity EndVelocity =
363 	       	
364 	        		null
365 	        	;
366 	
367 	        
368 	        
369  		/**
370          * 
371 			This is relative velocity direction vector that will affect the speed and direction of the balls
372             going in. Default (-10,-10,-10).
373 		 
374          */
375         public Velocity getEndVelocity()
376  	
377 	        {
378 	            return
379 	        	 EndVelocity;
380 	        }
381 	        
382 	        
383 	        
384  		
385  		/**
386          * 
387 			This is relative velocity direction vector that will affect the speed and direction of the balls
388             going in. Default (-10,-10,-10).
389 		 
390          */
391         public SetEmotionalEmitter 
392         setEndVelocity(Velocity EndVelocity)
393  	
394 			{
395 				this.EndVelocity = EndVelocity;
396 				return this;
397 			}
398 		
399 	        /**
400 	        
401 			This will affect the speed of the balls. Default -20.
402 		 
403 	        */
404 	        protected
405 	         Double VelocityRange =
406 	       	
407 	        		null
408 	        	;
409 	
410 	        
411 	        
412  		/**
413          * 
414 			This will affect the speed of the balls. Default -20.
415 		 
416          */
417         public Double getVelocityRange()
418  	
419 	        {
420 	            return
421 	        	 VelocityRange;
422 	        }
423 	        
424 	        
425 	        
426  		
427  		/**
428          * 
429 			This will affect the speed of the balls. Default -20.
430 		 
431          */
432         public SetEmotionalEmitter 
433         setVelocityRange(Double VelocityRange)
434  	
435 			{
436 				this.VelocityRange = VelocityRange;
437 				return this;
438 			}
439 		
440 	        /**
441 	        
442 			This will affect the size of the balls. Default (4,4,8).
443 		 
444 	        */
445 	        protected
446 	         Vector3d Size =
447 	       	
448 	        		null
449 	        	;
450 	
451 	        
452 	        
453  		/**
454          * 
455 			This will affect the size of the balls. Default (4,4,8).
456 		 
457          */
458         public Vector3d getSize()
459  	
460 	        {
461 	            return
462 	        	 Size;
463 	        }
464 	        
465 	        
466 	        
467  		
468  		/**
469          * 
470 			This will affect the size of the balls. Default (4,4,8).
471 		 
472          */
473         public SetEmotionalEmitter 
474         setSize(Vector3d Size)
475  	
476 			{
477 				this.Size = Size;
478 				return this;
479 			}
480 		
481 	        /**
482 	        
483 			This will affect the life time of the balls and radius and speed they will
484             be traversing. Default 1.6.
485 		 
486 	        */
487 	        protected
488 	         Double LifeTime =
489 	       	
490 	        		null
491 	        	;
492 	
493 	        
494 	        
495  		/**
496          * 
497 			This will affect the life time of the balls and radius and speed they will
498             be traversing. Default 1.6.
499 		 
500          */
501         public Double getLifeTime()
502  	
503 	        {
504 	            return
505 	        	 LifeTime;
506 	        }
507 	        
508 	        
509 	        
510  		
511  		/**
512          * 
513 			This will affect the life time of the balls and radius and speed they will
514             be traversing. Default 1.6.
515 		 
516          */
517         public SetEmotionalEmitter 
518         setLifeTime(Double LifeTime)
519  	
520 			{
521 				this.LifeTime = LifeTime;
522 				return this;
523 			}
524 		
525 	        /**
526 	        
527 			This will affect the fade in and fade out times of the balls. First value affects
528             the starting fade out time. Second value will affect ending fade in time. The third
529             value in the vector is ignored.
530 		 
531 	        */
532 	        protected
533 	         Vector3d FadeTime =
534 	       	
535 	        		null
536 	        	;
537 	
538 	        
539 	        
540  		/**
541          * 
542 			This will affect the fade in and fade out times of the balls. First value affects
543             the starting fade out time. Second value will affect ending fade in time. The third
544             value in the vector is ignored.
545 		 
546          */
547         public Vector3d getFadeTime()
548  	
549 	        {
550 	            return
551 	        	 FadeTime;
552 	        }
553 	        
554 	        
555 	        
556  		
557  		/**
558          * 
559 			This will affect the fade in and fade out times of the balls. First value affects
560             the starting fade out time. Second value will affect ending fade in time. The third
561             value in the vector is ignored.
562 		 
563          */
564         public SetEmotionalEmitter 
565         setFadeTime(Vector3d FadeTime)
566  	
567 			{
568 				this.FadeTime = FadeTime;
569 				return this;
570 			}
571 		
572  	    public String toString() {
573             return toMessage();
574         }
575  	
576  		public String toHtmlString() {
577 			return super.toString() + "[<br/>" +
578             	
579             	"<b>Disable</b> = " +
580             	String.valueOf(isDisable()
581  	) +
582             	" <br/> " +
583             	
584             	"<b>Pause</b> = " +
585             	String.valueOf(isPause()
586  	) +
587             	" <br/> " +
588             	
589             	"<b>FirstC</b> = " +
590             	String.valueOf(getFirstC()
591  	) +
592             	" <br/> " +
593             	
594             	"<b>SecondC</b> = " +
595             	String.valueOf(getSecondC()
596  	) +
597             	" <br/> " +
598             	
599             	"<b>StartVelocity</b> = " +
600             	String.valueOf(getStartVelocity()
601  	) +
602             	" <br/> " +
603             	
604             	"<b>EndVelocity</b> = " +
605             	String.valueOf(getEndVelocity()
606  	) +
607             	" <br/> " +
608             	
609             	"<b>VelocityRange</b> = " +
610             	String.valueOf(getVelocityRange()
611  	) +
612             	" <br/> " +
613             	
614             	"<b>Size</b> = " +
615             	String.valueOf(getSize()
616  	) +
617             	" <br/> " +
618             	
619             	"<b>LifeTime</b> = " +
620             	String.valueOf(getLifeTime()
621  	) +
622             	" <br/> " +
623             	
624             	"<b>FadeTime</b> = " +
625             	String.valueOf(getFadeTime()
626  	) +
627             	" <br/> " +
628             	 
629             	"<br/>]"
630             ;
631 		}
632  	
633 		public String toMessage() {
634      		StringBuffer buf = new StringBuffer();
635      		buf.append("SETEMIT");
636      		
637 						if (Disable != null) {
638 							buf.append(" {Disable " + Disable + "}");
639 						}
640 					
641 						if (Pause != null) {
642 							buf.append(" {Pause " + Pause + "}");
643 						}
644 					
645 						if (FirstC != null) {
646 							buf.append(" {FirstC " +
647 								FirstC.getX() + "," +
648 								FirstC.getY() + "," +
649 								FirstC.getZ() + "}");
650 						}
651 					
652 						if (SecondC != null) {
653 							buf.append(" {SecondC " +
654 								SecondC.getX() + "," +
655 								SecondC.getY() + "," +
656 								SecondC.getZ() + "}");
657 						}
658 					
659 					    if (StartVelocity != null) {
660 					        buf.append(" {StartVelocity " +
661 					            StartVelocity.getX() + "," +
662 					            StartVelocity.getY() + "," +
663 					            StartVelocity.getZ() + "}");
664 					    }
665 					
666 					    if (EndVelocity != null) {
667 					        buf.append(" {EndVelocity " +
668 					            EndVelocity.getX() + "," +
669 					            EndVelocity.getY() + "," +
670 					            EndVelocity.getZ() + "}");
671 					    }
672 					
673 						if (VelocityRange != null) {
674 							buf.append(" {VelocityRange " + VelocityRange + "}");
675 						}
676 					
677 						if (Size != null) {
678 							buf.append(" {Size " +
679 								Size.getX() + "," +
680 								Size.getY() + "," +
681 								Size.getZ() + "}");
682 						}
683 					
684 						if (LifeTime != null) {
685 							buf.append(" {LifeTime " + LifeTime + "}");
686 						}
687 					
688 						if (FadeTime != null) {
689 							buf.append(" {FadeTime " +
690 								FadeTime.getX() + "," +
691 								FadeTime.getY() + "," +
692 								FadeTime.getZ() + "}");
693 						}
694 					
695    			return buf.toString();
696    		}
697  	
698  		// --- Extra Java from XML BEGIN (extra/code/java)
699         	
700 		// --- Extra Java from XML END (extra/code/java)
701  	
702 	        }
703