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