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 MOVE.
15   		 *
16   		 * 
17  		The bot will start moving towards FirstLocation. After reaching it will continue
18  		to SecondLocation (no delay). If no SecondLocation specified, the movement will end at
19  		FirstLocation point.
20  		You can specify some location or object you will be facing during the movement (if none specified,
21  		the bot will start looking towards its destination point). Object	is specified by UnrealId. 
22  		Player Ids will work, all NavPoints Ids and Movers. Respawned items should work too, but not all of 
23  		the items have unique Id, thus item Ids are not recommended.		
24  	
25           */
26   	public class Move 
27  		extends CommandMessage
28  	        {
29  	        	
30  		        
31      	/** Example how the message looks like - used during parser tests. */
32      	public static final String PROTOTYPE =
33      		" {FirstLocation 0,0,0}  {SecondLocation 0,0,0}  {FocusTarget unreal_id}  {FocusLocation 0,0,0} ";
34      
35  		/**
36  		 * Creates new instance of command Move.
37  		 * 
38  		The bot will start moving towards FirstLocation. After reaching it will continue
39  		to SecondLocation (no delay). If no SecondLocation specified, the movement will end at
40  		FirstLocation point.
41  		You can specify some location or object you will be facing during the movement (if none specified,
42  		the bot will start looking towards its destination point). Object	is specified by UnrealId. 
43  		Player Ids will work, all NavPoints Ids and Movers. Respawned items should work too, but not all of 
44  		the items have unique Id, thus item Ids are not recommended.		
45  	
46  		 * Corresponding GameBots message for this command is
47  		 * MOVE.
48  		 *
49  		 * 
50  		 *    @param FirstLocation The bot will start moving to this location first. If not specified, the bot won't move (even if SecondLocation is specified).   
51  		 *    @param SecondLocation After reaching FirstLocation, the bot will start moving to location specified here. If not specified the movement will quit at FirstLocation point.
52  		 *    @param FocusTarget Here you can specify UnrealId of the object you want to face during movement (typically enemy player you want to shoot at). Player Ids will work, all NavPoints Ids, Movers and some of the items (with unique Id). This attribute is parsed before FocusLocation attribute and if set FocusLocation attribute will be ignored.
53  		 *    @param FocusLocation Here you can specify location you want to face during movement. This attribute is parsed after FocusTarget attribute and will be ignored if FocusTarget is set.
54  		 */
55  		public Move(
56  			Location FirstLocation,  Location SecondLocation,  UnrealId FocusTarget,  Location FocusLocation
57  		) {
58  			
59  				this.FirstLocation = FirstLocation;
60              
61  				this.SecondLocation = SecondLocation;
62              
63  				this.FocusTarget = FocusTarget;
64              
65  				this.FocusLocation = FocusLocation;
66              
67  		}
68  
69  		
70  			/**
71  			 * Creates new instance of command Move.
72  			 * 
73  		The bot will start moving towards FirstLocation. After reaching it will continue
74  		to SecondLocation (no delay). If no SecondLocation specified, the movement will end at
75  		FirstLocation point.
76  		You can specify some location or object you will be facing during the movement (if none specified,
77  		the bot will start looking towards its destination point). Object	is specified by UnrealId. 
78  		Player Ids will work, all NavPoints Ids and Movers. Respawned items should work too, but not all of 
79  		the items have unique Id, thus item Ids are not recommended.		
80  	
81  			 * Corresponding GameBots message for this command is
82  			 * MOVE.
83  			 * <p></p>
84  			 * WARNING: this is empty-command constructor, you have to use setters to fill it up with data that should be sent to GameBots2004!
85  		     */
86  		    public Move() {
87  		    }
88  			
89  		
90  		/**
91  		 * Cloning constructor.
92  		 *
93  		 * @param original
94  		 */
95  		public Move(Move original) {
96  		   
97  		        this.FirstLocation = original.FirstLocation;
98  		   
99  		        this.SecondLocation = original.SecondLocation;
100 		   
101 		        this.FocusTarget = original.FocusTarget;
102 		   
103 		        this.FocusLocation = original.FocusLocation;
104 		   
105 		}
106     
107 	        /**
108 	        The bot will start moving to this location first. If not specified, the bot won't move (even if SecondLocation is specified).    
109 	        */
110 	        protected
111 	         Location FirstLocation =
112 	       	
113 	        		null
114 	        	;
115 	
116 	        
117 	        
118  		/**
119          * The bot will start moving to this location first. If not specified, the bot won't move (even if SecondLocation is specified).    
120          */
121         public Location getFirstLocation()
122  	
123 	        {
124 	            return
125 	        	 FirstLocation;
126 	        }
127 	        
128 	        
129 	        
130  		
131  		/**
132          * The bot will start moving to this location first. If not specified, the bot won't move (even if SecondLocation is specified).    
133          */
134         public Move 
135         setFirstLocation(Location FirstLocation)
136  	
137 			{
138 				this.FirstLocation = FirstLocation;
139 				return this;
140 			}
141 		
142 	        /**
143 	        After reaching FirstLocation, the bot will start moving to location specified here. If not specified the movement will quit at FirstLocation point. 
144 	        */
145 	        protected
146 	         Location SecondLocation =
147 	       	
148 	        		null
149 	        	;
150 	
151 	        
152 	        
153  		/**
154          * After reaching FirstLocation, the bot will start moving to location specified here. If not specified the movement will quit at FirstLocation point. 
155          */
156         public Location getSecondLocation()
157  	
158 	        {
159 	            return
160 	        	 SecondLocation;
161 	        }
162 	        
163 	        
164 	        
165  		
166  		/**
167          * After reaching FirstLocation, the bot will start moving to location specified here. If not specified the movement will quit at FirstLocation point. 
168          */
169         public Move 
170         setSecondLocation(Location SecondLocation)
171  	
172 			{
173 				this.SecondLocation = SecondLocation;
174 				return this;
175 			}
176 		
177 	        /**
178 	        Here you can specify UnrealId of the object you want to face during movement (typically enemy player you want to shoot at). Player Ids will work, all NavPoints Ids, Movers and some of the items (with unique Id). This attribute is parsed before FocusLocation attribute and if set FocusLocation attribute will be ignored. 
179 	        */
180 	        protected
181 	         UnrealId FocusTarget =
182 	       	
183 	        		null
184 	        	;
185 	
186 	        
187 	        
188  		/**
189          * Here you can specify UnrealId of the object you want to face during movement (typically enemy player you want to shoot at). Player Ids will work, all NavPoints Ids, Movers and some of the items (with unique Id). This attribute is parsed before FocusLocation attribute and if set FocusLocation attribute will be ignored. 
190          */
191         public UnrealId getFocusTarget()
192  	
193 	        {
194 	            return
195 	        	 FocusTarget;
196 	        }
197 	        
198 	        
199 	        
200  		
201  		/**
202          * Here you can specify UnrealId of the object you want to face during movement (typically enemy player you want to shoot at). Player Ids will work, all NavPoints Ids, Movers and some of the items (with unique Id). This attribute is parsed before FocusLocation attribute and if set FocusLocation attribute will be ignored. 
203          */
204         public Move 
205         setFocusTarget(UnrealId FocusTarget)
206  	
207 			{
208 				this.FocusTarget = FocusTarget;
209 				return this;
210 			}
211 		
212 	        /**
213 	        Here you can specify location you want to face during movement. This attribute is parsed after FocusTarget attribute and will be ignored if FocusTarget is set. 
214 	        */
215 	        protected
216 	         Location FocusLocation =
217 	       	
218 	        		null
219 	        	;
220 	
221 	        
222 	        
223  		/**
224          * Here you can specify location you want to face during movement. This attribute is parsed after FocusTarget attribute and will be ignored if FocusTarget is set. 
225          */
226         public Location getFocusLocation()
227  	
228 	        {
229 	            return
230 	        	 FocusLocation;
231 	        }
232 	        
233 	        
234 	        
235  		
236  		/**
237          * Here you can specify location you want to face during movement. This attribute is parsed after FocusTarget attribute and will be ignored if FocusTarget is set. 
238          */
239         public Move 
240         setFocusLocation(Location FocusLocation)
241  	
242 			{
243 				this.FocusLocation = FocusLocation;
244 				return this;
245 			}
246 		
247  	    public String toString() {
248             return toMessage();
249         }
250  	
251  		public String toHtmlString() {
252 			return super.toString() + "[<br/>" +
253             	
254             	"<b>FirstLocation</b> = " +
255             	String.valueOf(getFirstLocation()
256  	) +
257             	" <br/> " +
258             	
259             	"<b>SecondLocation</b> = " +
260             	String.valueOf(getSecondLocation()
261  	) +
262             	" <br/> " +
263             	
264             	"<b>FocusTarget</b> = " +
265             	String.valueOf(getFocusTarget()
266  	) +
267             	" <br/> " +
268             	
269             	"<b>FocusLocation</b> = " +
270             	String.valueOf(getFocusLocation()
271  	) +
272             	" <br/> " +
273             	 
274             	"<br/>]"
275             ;
276 		}
277  	
278 		public String toMessage() {
279      		StringBuffer buf = new StringBuffer();
280      		buf.append("MOVE");
281      		
282 					    if (FirstLocation != null) {
283 					        buf.append(" {FirstLocation " +
284 					            FirstLocation.getX() + "," +
285 					            FirstLocation.getY() + "," +
286 					            FirstLocation.getZ() + "}");
287 					    }
288 					
289 					    if (SecondLocation != null) {
290 					        buf.append(" {SecondLocation " +
291 					            SecondLocation.getX() + "," +
292 					            SecondLocation.getY() + "," +
293 					            SecondLocation.getZ() + "}");
294 					    }
295 					
296 						if (FocusTarget != null) {
297 							buf.append(" {FocusTarget " + FocusTarget.getStringId() + "}");
298 						}
299 					
300 					    if (FocusLocation != null) {
301 					        buf.append(" {FocusLocation " +
302 					            FocusLocation.getX() + "," +
303 					            FocusLocation.getY() + "," +
304 					            FocusLocation.getZ() + "}");
305 					    }
306 					
307    			return buf.toString();
308    		}
309  	
310  		// --- Extra Java from XML BEGIN (extra/code/java)
311         	
312 		// --- Extra Java from XML END (extra/code/java)
313  	
314 	        }
315