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 FORCECAMMOVE.
15   		 *
16   		 * 
17  		Moves with the player that was previously set as a camera.
18  	
19           */
20   	public class MoveCamera 
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}  {Destination 0,0,0}  {Direction 0,0,0}  {Rotation 0,0,0}  {RotationSpeed 0,0,0}  {Speed 0}  {Time 0} ";
28      
29  		/**
30  		 * Creates new instance of command MoveCamera.
31  		 * 
32  		Moves with the player that was previously set as a camera.
33  	
34  		 * Corresponding GameBots message for this command is
35  		 * FORCECAMMOVE.
36  		 *
37  		 * 
38  		 *    @param Id UnrealId of the player that is a camera and that we want to move. 
39  		 *    @param Destination Final destination where the camera should move. 
40  		 *    @param Direction Vector that sets direction of the move of this camera. 
41  		 *    @param Rotation Desired rotation. 
42  		 *    @param RotationSpeed Desired rotation speed. 
43  		 *    @param Speed Set the speed of the move of this camera. 
44  		 *    @param Time How long this move of this camera will last (in seconds). 
45  		 */
46  		public MoveCamera(
47  			UnrealId Id,  Location Destination,  Vector3d Direction,  Rotation Rotation,  Rotation RotationSpeed,  Double Speed,  Double Time
48  		) {
49  			
50  				this.Id = Id;
51              
52  				this.Destination = Destination;
53              
54  				this.Direction = Direction;
55              
56  				this.Rotation = Rotation;
57              
58  				this.RotationSpeed = RotationSpeed;
59              
60  				this.Speed = Speed;
61              
62  				this.Time = Time;
63              
64  		}
65  
66  		
67  			/**
68  			 * Creates new instance of command MoveCamera.
69  			 * 
70  		Moves with the player that was previously set as a camera.
71  	
72  			 * Corresponding GameBots message for this command is
73  			 * FORCECAMMOVE.
74  			 * <p></p>
75  			 * WARNING: this is empty-command constructor, you have to use setters to fill it up with data that should be sent to GameBots2004!
76  		     */
77  		    public MoveCamera() {
78  		    }
79  			
80  		
81  		/**
82  		 * Cloning constructor.
83  		 *
84  		 * @param original
85  		 */
86  		public MoveCamera(MoveCamera original) {
87  		   
88  		        this.Id = original.Id;
89  		   
90  		        this.Destination = original.Destination;
91  		   
92  		        this.Direction = original.Direction;
93  		   
94  		        this.Rotation = original.Rotation;
95  		   
96  		        this.RotationSpeed = original.RotationSpeed;
97  		   
98  		        this.Speed = original.Speed;
99  		   
100 		        this.Time = original.Time;
101 		   
102 		}
103     
104 	        /**
105 	        UnrealId of the player that is a camera and that we want to move.  
106 	        */
107 	        protected
108 	         UnrealId Id =
109 	       	
110 	        		null
111 	        	;
112 	
113 	        
114 	        
115  		/**
116          * UnrealId of the player that is a camera and that we want to move.  
117          */
118         public UnrealId getId()
119  	
120 	        {
121 	            return
122 	        	 Id;
123 	        }
124 	        
125 	        
126 	        
127  		
128  		/**
129          * UnrealId of the player that is a camera and that we want to move.  
130          */
131         public MoveCamera 
132         setId(UnrealId Id)
133  	
134 			{
135 				this.Id = Id;
136 				return this;
137 			}
138 		
139 	        /**
140 	        Final destination where the camera should move.  
141 	        */
142 	        protected
143 	         Location Destination =
144 	       	
145 	        		null
146 	        	;
147 	
148 	        
149 	        
150  		/**
151          * Final destination where the camera should move.  
152          */
153         public Location getDestination()
154  	
155 	        {
156 	            return
157 	        	 Destination;
158 	        }
159 	        
160 	        
161 	        
162  		
163  		/**
164          * Final destination where the camera should move.  
165          */
166         public MoveCamera 
167         setDestination(Location Destination)
168  	
169 			{
170 				this.Destination = Destination;
171 				return this;
172 			}
173 		
174 	        /**
175 	        Vector that sets direction of the move of this camera.  
176 	        */
177 	        protected
178 	         Vector3d Direction =
179 	       	
180 	        		null
181 	        	;
182 	
183 	        
184 	        
185  		/**
186          * Vector that sets direction of the move of this camera.  
187          */
188         public Vector3d getDirection()
189  	
190 	        {
191 	            return
192 	        	 Direction;
193 	        }
194 	        
195 	        
196 	        
197  		
198  		/**
199          * Vector that sets direction of the move of this camera.  
200          */
201         public MoveCamera 
202         setDirection(Vector3d Direction)
203  	
204 			{
205 				this.Direction = Direction;
206 				return this;
207 			}
208 		
209 	        /**
210 	        Desired rotation.  
211 	        */
212 	        protected
213 	         Rotation Rotation =
214 	       	
215 	        		null
216 	        	;
217 	
218 	        
219 	        
220  		/**
221          * Desired rotation.  
222          */
223         public Rotation getRotation()
224  	
225 	        {
226 	            return
227 	        	 Rotation;
228 	        }
229 	        
230 	        
231 	        
232  		
233  		/**
234          * Desired rotation.  
235          */
236         public MoveCamera 
237         setRotation(Rotation Rotation)
238  	
239 			{
240 				this.Rotation = Rotation;
241 				return this;
242 			}
243 		
244 	        /**
245 	        Desired rotation speed.  
246 	        */
247 	        protected
248 	         Rotation RotationSpeed =
249 	       	
250 	        		null
251 	        	;
252 	
253 	        
254 	        
255  		/**
256          * Desired rotation speed.  
257          */
258         public Rotation getRotationSpeed()
259  	
260 	        {
261 	            return
262 	        	 RotationSpeed;
263 	        }
264 	        
265 	        
266 	        
267  		
268  		/**
269          * Desired rotation speed.  
270          */
271         public MoveCamera 
272         setRotationSpeed(Rotation RotationSpeed)
273  	
274 			{
275 				this.RotationSpeed = RotationSpeed;
276 				return this;
277 			}
278 		
279 	        /**
280 	        Set the speed of the move of this camera.  
281 	        */
282 	        protected
283 	         Double Speed =
284 	       	
285 	        		null
286 	        	;
287 	
288 	        
289 	        
290  		/**
291          * Set the speed of the move of this camera.  
292          */
293         public Double getSpeed()
294  	
295 	        {
296 	            return
297 	        	 Speed;
298 	        }
299 	        
300 	        
301 	        
302  		
303  		/**
304          * Set the speed of the move of this camera.  
305          */
306         public MoveCamera 
307         setSpeed(Double Speed)
308  	
309 			{
310 				this.Speed = Speed;
311 				return this;
312 			}
313 		
314 	        /**
315 	        How long this move of this camera will last (in seconds).  
316 	        */
317 	        protected
318 	         Double Time =
319 	       	
320 	        		null
321 	        	;
322 	
323 	        
324 	        
325  		/**
326          * How long this move of this camera will last (in seconds).  
327          */
328         public Double getTime()
329  	
330 	        {
331 	            return
332 	        	 Time;
333 	        }
334 	        
335 	        
336 	        
337  		
338  		/**
339          * How long this move of this camera will last (in seconds).  
340          */
341         public MoveCamera 
342         setTime(Double Time)
343  	
344 			{
345 				this.Time = Time;
346 				return this;
347 			}
348 		
349  	    public String toString() {
350             return toMessage();
351         }
352  	
353  		public String toHtmlString() {
354 			return super.toString() + "[<br/>" +
355             	
356             	"<b>Id</b> = " +
357             	String.valueOf(getId()
358  	) +
359             	" <br/> " +
360             	
361             	"<b>Destination</b> = " +
362             	String.valueOf(getDestination()
363  	) +
364             	" <br/> " +
365             	
366             	"<b>Direction</b> = " +
367             	String.valueOf(getDirection()
368  	) +
369             	" <br/> " +
370             	
371             	"<b>Rotation</b> = " +
372             	String.valueOf(getRotation()
373  	) +
374             	" <br/> " +
375             	
376             	"<b>RotationSpeed</b> = " +
377             	String.valueOf(getRotationSpeed()
378  	) +
379             	" <br/> " +
380             	
381             	"<b>Speed</b> = " +
382             	String.valueOf(getSpeed()
383  	) +
384             	" <br/> " +
385             	
386             	"<b>Time</b> = " +
387             	String.valueOf(getTime()
388  	) +
389             	" <br/> " +
390             	 
391             	"<br/>]"
392             ;
393 		}
394  	
395 		public String toMessage() {
396      		StringBuffer buf = new StringBuffer();
397      		buf.append("FORCECAMMOVE");
398      		
399 						if (Id != null) {
400 							buf.append(" {Id " + Id.getStringId() + "}");
401 						}
402 					
403 					    if (Destination != null) {
404 					        buf.append(" {Destination " +
405 					            Destination.getX() + "," +
406 					            Destination.getY() + "," +
407 					            Destination.getZ() + "}");
408 					    }
409 					
410 						if (Direction != null) {
411 							buf.append(" {Direction " +
412 								Direction.getX() + "," +
413 								Direction.getY() + "," +
414 								Direction.getZ() + "}");
415 						}
416 					
417 					    if (Rotation != null) {
418 					        buf.append(" {Rotation " +
419 					            Rotation.getPitch() + "," +
420 					            Rotation.getYaw() + "," +
421 					            Rotation.getRoll() + "}");
422 					    }
423 					
424 					    if (RotationSpeed != null) {
425 					        buf.append(" {RotationSpeed " +
426 					            RotationSpeed.getPitch() + "," +
427 					            RotationSpeed.getYaw() + "," +
428 					            RotationSpeed.getRoll() + "}");
429 					    }
430 					
431 						if (Speed != null) {
432 							buf.append(" {Speed " + Speed + "}");
433 						}
434 					
435 						if (Time != null) {
436 							buf.append(" {Time " + Time + "}");
437 						}
438 					
439    			return buf.toString();
440    		}
441  	
442  		// --- Extra Java from XML BEGIN (extra/code/java)
443         	
444 		// --- Extra Java from XML END (extra/code/java)
445  	
446 	        }
447