View Javadoc

1   
2               /**
3               IMPORTANT !!!
4   
5               DO NOT EDIT THIS FILE. IT IS GENERATED FROM approriate xml file in xmlresources/gbinfomessages 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.gbinfomessages;
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  		Aynchronous message. Response to TRACE command.
35  	
36                            Corresponding GameBots message is
37                            TRC.
38                        
39               */
40              
41              public class
42              TraceResponse
43                      extends GBEvent
44                  
45  	            	implements IWorldEvent, IWorldChangeEvent
46  
47              {
48              
49              /**
50                Creates new instance of command TraceResponse.
51                
52  		Aynchronous message. Response to TRACE command.
53  	Corresponding GameBots message for this command is
54                .
55                    @param Id 
56  			An Id matching the one sent by client. Allows bot to match
57  			answer with right query.
58  		
59                    @param From 
60  			Location from which the ray is emitted.
61  		
62                    @param To 
63  			Location to which the ray is sent.
64  		
65                    @param Result 
66  			True if it hit something, false if not.
67  		
68                    @param HitNormal 
69  			Normal vector to the trace ray in the point of hit.
70  		
71                    @param HitLocation Point of the hit.
72                    @param HitID 
73  			Id of the thing we have hit. May be other player or some
74  			item or level geometry.
75  		
76                    @param TraceActors 
77  			True if we are tracing also actors in the game (players,
78  			items). False if we are tracing just level geometry.
79  		
80                */
81               public TraceResponse(
82                  String Id,  Location From,  Location To,  boolean Result,  Vector3d HitNormal,  Vector3d HitLocation,  UnrealId HitID,  boolean TraceActors) {
83                      
84                      this.Id = Id;
85                  
86                      this.From = From;
87                  
88                      this.To = To;
89                  
90                      this.Result = Result;
91                  
92                      this.HitNormal = HitNormal;
93                  
94                      this.HitLocation = HitLocation;
95                  
96                      this.HitID = HitID;
97                  
98                      this.TraceActors = TraceActors;
99                  
100                 }
101 
102             
103     	/** Example how the message looks like - used during parser tests. */
104     	public static final String PROTOTYPE =
105     		"TRC {Id text} {From 0,0,0} {To 0,0,0} {Result False} {HitNormal 0,0,0} {HitLocation 0,0,0} {HitID unreal_id} {TraceActors False}";
106     
107 
108             /////// Properties BEGIN
109             
110         /**
111         
112 			An Id matching the one sent by client. Allows bot to match
113 			answer with right query.
114 		 */
115         protected
116          String Id =
117         	null;
118 
119         
120         /**
121         
122 			An Id matching the one sent by client. Allows bot to match
123 			answer with right query.
124 		 */
125         public
126         String getId() {
127             return
128          Id;
129         }
130         
131 
132         
133         /**
134         
135 			Location from which the ray is emitted.
136 		 */
137         protected
138          Location From =
139         	null;
140 
141         
142         /**
143         
144 			Location from which the ray is emitted.
145 		 */
146         public
147         Location getFrom() {
148             return
149          From;
150         }
151         
152 
153         
154         /**
155         
156 			Location to which the ray is sent.
157 		 */
158         protected
159          Location To =
160         	null;
161 
162         
163         /**
164         
165 			Location to which the ray is sent.
166 		 */
167         public
168         Location getTo() {
169             return
170          To;
171         }
172         
173 
174         
175         /**
176         
177 			True if it hit something, false if not.
178 		 */
179         protected
180          boolean Result =
181         	false;
182 
183         
184         /**
185         
186 			True if it hit something, false if not.
187 		 */
188         public
189         boolean isResult() {
190             return
191          Result;
192         }
193         
194 
195         
196         /**
197         
198 			Normal vector to the trace ray in the point of hit.
199 		 */
200         protected
201          Vector3d HitNormal =
202         	null;
203 
204         
205         /**
206         
207 			Normal vector to the trace ray in the point of hit.
208 		 */
209         public
210         Vector3d getHitNormal() {
211             return
212          HitNormal;
213         }
214         
215 
216         
217         /**
218         Point of the hit. */
219         protected
220          Vector3d HitLocation =
221         	null;
222 
223         
224         /**
225         Point of the hit. */
226         public
227         Vector3d getHitLocation() {
228             return
229          HitLocation;
230         }
231         
232 
233         
234         /**
235         
236 			Id of the thing we have hit. May be other player or some
237 			item or level geometry.
238 		 */
239         protected
240          UnrealId HitID =
241         	null;
242 
243         
244         /**
245         
246 			Id of the thing we have hit. May be other player or some
247 			item or level geometry.
248 		 */
249         public
250         UnrealId getHitID() {
251             return
252          HitID;
253         }
254         
255 
256         
257         /**
258         
259 			True if we are tracing also actors in the game (players,
260 			items). False if we are tracing just level geometry.
261 		 */
262         protected
263          boolean TraceActors =
264         	false;
265 
266         
267         /**
268         
269 			True if we are tracing also actors in the game (players,
270 			items). False if we are tracing just level geometry.
271 		 */
272         public
273         boolean isTraceActors() {
274             return
275          TraceActors;
276         }
277         
278 
279         
280             /////// Properties END
281 
282             /////// Extra Java code BEGIN
283 
284             	/////// Additional code from xslt BEGIN
285             		
286        					public long getSimTime() {
287        						// NOT IMPLEMENTED FOR UDK
288        						return 0;
289        					}
290             		
291 
292 
293             	/////// Additional code from xslt END
294 
295 	            /////// Extra Java from XML BEGIN
296             		
297             	/////// Extra Java from XML END
298 
299             /////// Extra Java code END
300 
301             
302 
303             /**
304               * Cloning constructor.
305               */
306              public TraceResponse(TraceResponse original) {
307                 
308                      this.Id=original.Id;
309                 
310                      this.From=original.From;
311                 
312                      this.To=original.To;
313                 
314                      this.Result=original.Result;
315                 
316                      this.HitNormal=original.HitNormal;
317                 
318                      this.HitLocation=original.HitLocation;
319                 
320                      this.HitID=original.HitID;
321                 
322                      this.TraceActors=original.TraceActors;
323                 
324              }
325 
326              
327                  /**
328                   * Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
329                   */
330 	             public TraceResponse() {
331 	             }
332              
333 
334                  
335             public String toString() {
336                 return
337                 
338                 		super.toString() + " | " +
339                 		
340 				               "Id = " +
341 				               String.valueOf(Id) + " | " +
342 				            
343 				               "From = " +
344 				               String.valueOf(From) + " | " +
345 				            
346 				               "To = " +
347 				               String.valueOf(To) + " | " +
348 				            
349 				               "Result = " +
350 				               String.valueOf(Result) + " | " +
351 				            
352 				               "HitNormal = " +
353 				               String.valueOf(HitNormal) + " | " +
354 				            
355 				               "HitLocation = " +
356 				               String.valueOf(HitLocation) + " | " +
357 				            
358 				               "HitID = " +
359 				               String.valueOf(HitID) + " | " +
360 				            
361 				               "TraceActors = " +
362 				               String.valueOf(TraceActors) + " | " +
363 				             "";
364                 	
365              }
366 
367              public String toHtmlString() {
368                 return super.toString() +
369             
370             "<b>Id</b> : " +
371             String.valueOf(Id) +
372             " <br/> " +
373             
374             "<b>From</b> : " +
375             String.valueOf(From) +
376             " <br/> " +
377             
378             "<b>To</b> : " +
379             String.valueOf(To) +
380             " <br/> " +
381             
382             "<b>Result</b> : " +
383             String.valueOf(Result) +
384             " <br/> " +
385             
386             "<b>HitNormal</b> : " +
387             String.valueOf(HitNormal) +
388             " <br/> " +
389             
390             "<b>HitLocation</b> : " +
391             String.valueOf(HitLocation) +
392             " <br/> " +
393             
394             "<b>HitID</b> : " +
395             String.valueOf(HitID) +
396             " <br/> " +
397             
398             "<b>TraceActors</b> : " +
399             String.valueOf(TraceActors) +
400             " <br/> " +
401              "";
402              }
403 
404              
405              
406              }
407 
408