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