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 FORCECAM.
15   		 *
16   		 * 
17  		Sets input player to be a camera (he want be able to control himself). This player/camera can be controlled
18  		by MoveCamera command. Also sets camera location and rotation.
19  	
20           */
21   	public class SetCamera 
22  		extends CommandMessage
23  	        {
24  	        	
25  		        
26      	/** Example how the message looks like - used during parser tests. */
27      	public static final String PROTOTYPE =
28      		" {Id unreal_id}  {Location 0,0,0}  {Rotation 0,0,0}  {Release False} ";
29      
30  		/**
31  		 * Creates new instance of command SetCamera.
32  		 * 
33  		Sets input player to be a camera (he want be able to control himself). This player/camera can be controlled
34  		by MoveCamera command. Also sets camera location and rotation.
35  	
36  		 * Corresponding GameBots message for this command is
37  		 * FORCECAM.
38  		 *
39  		 * 
40  		 *    @param Id UnrealId of the player we want to set as a camera. 
41  		 *    @param Location Initial location of this camera. 
42  		 *    @param Rotation Initial rotation of this camera. 
43  		 *    @param Release True to release this player from camera mode. 
44  		 */
45  		public SetCamera(
46  			UnrealId Id,  Location Location,  Rotation Rotation,  Boolean Release
47  		) {
48  			
49  				this.Id = Id;
50              
51  				this.Location = Location;
52              
53  				this.Rotation = Rotation;
54              
55  				this.Release = Release;
56              
57  		}
58  
59  		
60  			/**
61  			 * Creates new instance of command SetCamera.
62  			 * 
63  		Sets input player to be a camera (he want be able to control himself). This player/camera can be controlled
64  		by MoveCamera command. Also sets camera location and rotation.
65  	
66  			 * Corresponding GameBots message for this command is
67  			 * FORCECAM.
68  			 * <p></p>
69  			 * WARNING: this is empty-command constructor, you have to use setters to fill it up with data that should be sent to GameBots2004!
70  		     */
71  		    public SetCamera() {
72  		    }
73  			
74  		
75  		/**
76  		 * Cloning constructor.
77  		 *
78  		 * @param original
79  		 */
80  		public SetCamera(SetCamera original) {
81  		   
82  		        this.Id = original.Id;
83  		   
84  		        this.Location = original.Location;
85  		   
86  		        this.Rotation = original.Rotation;
87  		   
88  		        this.Release = original.Release;
89  		   
90  		}
91      
92  	        /**
93  	        UnrealId of the player we want to set as a camera.  
94  	        */
95  	        protected
96  	         UnrealId Id =
97  	       	
98  	        		null
99  	        	;
100 	
101 	        
102 	        
103  		/**
104          * UnrealId of the player we want to set as a camera.  
105          */
106         public UnrealId getId()
107  	
108 	        {
109 	            return
110 	        	 Id;
111 	        }
112 	        
113 	        
114 	        
115  		
116  		/**
117          * UnrealId of the player we want to set as a camera.  
118          */
119         public SetCamera 
120         setId(UnrealId Id)
121  	
122 			{
123 				this.Id = Id;
124 				return this;
125 			}
126 		
127 	        /**
128 	        Initial location of this camera.  
129 	        */
130 	        protected
131 	         Location Location =
132 	       	
133 	        		null
134 	        	;
135 	
136 	        
137 	        
138  		/**
139          * Initial location of this camera.  
140          */
141         public Location getLocation()
142  	
143 	        {
144 	            return
145 	        	 Location;
146 	        }
147 	        
148 	        
149 	        
150  		
151  		/**
152          * Initial location of this camera.  
153          */
154         public SetCamera 
155         setLocation(Location Location)
156  	
157 			{
158 				this.Location = Location;
159 				return this;
160 			}
161 		
162 	        /**
163 	        Initial rotation of this camera.  
164 	        */
165 	        protected
166 	         Rotation Rotation =
167 	       	
168 	        		null
169 	        	;
170 	
171 	        
172 	        
173  		/**
174          * Initial rotation of this camera.  
175          */
176         public Rotation getRotation()
177  	
178 	        {
179 	            return
180 	        	 Rotation;
181 	        }
182 	        
183 	        
184 	        
185  		
186  		/**
187          * Initial rotation of this camera.  
188          */
189         public SetCamera 
190         setRotation(Rotation Rotation)
191  	
192 			{
193 				this.Rotation = Rotation;
194 				return this;
195 			}
196 		
197 	        /**
198 	        True to release this player from camera mode.  
199 	        */
200 	        protected
201 	         Boolean Release =
202 	       	
203 	        		null
204 	        	;
205 	
206 	        
207 	        
208  		/**
209          * True to release this player from camera mode.  
210          */
211         public Boolean isRelease()
212  	
213 	        {
214 	            return
215 	        	 Release;
216 	        }
217 	        
218 	        
219 	        
220  		
221  		/**
222          * True to release this player from camera mode.  
223          */
224         public SetCamera 
225         setRelease(Boolean Release)
226  	
227 			{
228 				this.Release = Release;
229 				return this;
230 			}
231 		
232  	    public String toString() {
233             return toMessage();
234         }
235  	
236  		public String toHtmlString() {
237 			return super.toString() + "[<br/>" +
238             	
239             	"<b>Id</b> = " +
240             	String.valueOf(getId()
241  	) +
242             	" <br/> " +
243             	
244             	"<b>Location</b> = " +
245             	String.valueOf(getLocation()
246  	) +
247             	" <br/> " +
248             	
249             	"<b>Rotation</b> = " +
250             	String.valueOf(getRotation()
251  	) +
252             	" <br/> " +
253             	
254             	"<b>Release</b> = " +
255             	String.valueOf(isRelease()
256  	) +
257             	" <br/> " +
258             	 
259             	"<br/>]"
260             ;
261 		}
262  	
263 		public String toMessage() {
264      		StringBuffer buf = new StringBuffer();
265      		buf.append("FORCECAM");
266      		
267 						if (Id != null) {
268 							buf.append(" {Id " + Id.getStringId() + "}");
269 						}
270 					
271 					    if (Location != null) {
272 					        buf.append(" {Location " +
273 					            Location.getX() + "," +
274 					            Location.getY() + "," +
275 					            Location.getZ() + "}");
276 					    }
277 					
278 					    if (Rotation != null) {
279 					        buf.append(" {Rotation " +
280 					            Rotation.getPitch() + "," +
281 					            Rotation.getYaw() + "," +
282 					            Rotation.getRoll() + "}");
283 					    }
284 					
285 						if (Release != null) {
286 							buf.append(" {Release " + Release + "}");
287 						}
288 					
289    			return buf.toString();
290    		}
291  	
292  		// --- Extra Java from XML BEGIN (extra/code/java)
293         	
294 		// --- Extra Java from XML END (extra/code/java)
295  	
296 	        }
297