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  		Will send a ray from specified location to specified
35  		destination, responds with TRC message. TRACE uses Trace
36  		function - slower then FastTrace function, but provides more
37  		information about collision.
38  	
39                            Corresponding GameBots command is
40                            TRACE.
41                        
42               */
43              
44              public class
45              Trace extends
46          CommandMessage
47  
48              {
49              
50              /**
51                Creates new instance of command Trace.
52                
53  		Will send a ray from specified location to specified
54  		destination, responds with TRC message. TRACE uses Trace
55  		function - slower then FastTrace function, but provides more
56  		information about collision.
57  	Corresponding GameBots message for this command is
58                TRACE.
59                    @param Id 
60  			Message Id made up by you and echoed in response so you can
61  			match up response with query.
62  		
63                    @param From 
64  			Origin point of the ray. If you won't support From
65  			attribute, current bot location will be taken as From.
66  		
67                    @param To Target point of the ray.
68                    @param TraceActors 
69  			When true it means that all actors will be traced – for
70  			example players, bots, monsters, items etc. in a game. With
71  			TraceActors false we trace just level geometry.
72  		
73                */
74               public Trace(
75                  String Id,  Location From,  Location To,  boolean TraceActors) {
76                      
77                      this.Id = Id;
78                  
79                      this.From = From;
80                  
81                      this.To = To;
82                  
83                      this.TraceActors = TraceActors;
84                  
85                  }
86  
87              
88              		/**
89  		             Creates new instance of command Trace.
90  		             
91  		Will send a ray from specified location to specified
92  		destination, responds with TRC message. TRACE uses Trace
93  		function - slower then FastTrace function, but provides more
94  		information about collision.
95  	Corresponding GameBots message for this command is
96  		             TRACE.
97  		             <p></p>WARNING: this is empty-command constructor, you have to use setters to fill it up!
98  		             */
99              		public  Trace() {
100             		}
101             	
102 
103             /////// Properties BEGIN
104             
105         /**
106         
107 			Message Id made up by you and echoed in response so you can
108 			match up response with query.
109 		 */
110         protected
111          String Id =
112         	null;
113 
114         
115         /**
116         
117 			Message Id made up by you and echoed in response so you can
118 			match up response with query.
119 		 */
120         public
121         String getId() {
122             return
123          Id;
124         }
125         
126 
127         
128             /**
129         
130 			Message Id made up by you and echoed in response so you can
131 			match up response with query.
132 		 */
133         public Trace setId(String Id) {
134             this.Id = Id;
135             return this;
136             }
137        
138         /**
139         
140 			Origin point of the ray. If you won't support From
141 			attribute, current bot location will be taken as From.
142 		 */
143         protected
144          Location From =
145         	null;
146 
147         
148         /**
149         
150 			Origin point of the ray. If you won't support From
151 			attribute, current bot location will be taken as From.
152 		 */
153         public
154         Location getFrom() {
155             return
156          From;
157         }
158         
159 
160         
161             /**
162         
163 			Origin point of the ray. If you won't support From
164 			attribute, current bot location will be taken as From.
165 		 */
166         public Trace setFrom(Location From) {
167             this.From = From;
168             return this;
169             }
170        
171         /**
172         Target point of the ray. */
173         protected
174          Location To =
175         	null;
176 
177         
178         /**
179         Target point of the ray. */
180         public
181         Location getTo() {
182             return
183          To;
184         }
185         
186 
187         
188             /**
189         Target point of the ray. */
190         public Trace setTo(Location To) {
191             this.To = To;
192             return this;
193             }
194        
195         /**
196         
197 			When true it means that all actors will be traced – for
198 			example players, bots, monsters, items etc. in a game. With
199 			TraceActors false we trace just level geometry.
200 		 */
201         protected
202          boolean TraceActors =
203         	false;
204 
205         
206         /**
207         
208 			When true it means that all actors will be traced – for
209 			example players, bots, monsters, items etc. in a game. With
210 			TraceActors false we trace just level geometry.
211 		 */
212         public
213         boolean isTraceActors() {
214             return
215          TraceActors;
216         }
217         
218 
219         
220             /**
221         
222 			When true it means that all actors will be traced – for
223 			example players, bots, monsters, items etc. in a game. With
224 			TraceActors false we trace just level geometry.
225 		 */
226         public Trace setTraceActors(boolean TraceActors) {
227             this.TraceActors = TraceActors;
228             return this;
229             }
230        
231             /////// Properties END
232 
233             /////// Extra Java code BEGIN
234 
235             	/////// Additional code from xslt BEGIN
236             		
237 
238 
239             	/////// Additional code from xslt END
240 
241 	            /////// Extra Java from XML BEGIN
242             		
243             	/////// Extra Java from XML END
244 
245             /////// Extra Java code END
246 
247             
248 
249             /**
250               * Cloning constructor.
251               */
252              public Trace(Trace original) {
253                 
254                      this.Id=original.Id;
255                 
256                      this.From=original.From;
257                 
258                      this.To=original.To;
259                 
260                      this.TraceActors=original.TraceActors;
261                 
262              }
263 
264              
265 
266                  
267             public String toString() {
268                 return
269                 
270                     	toMessage();
271                     
272              }
273 
274              public String toHtmlString() {
275                 return super.toString() +
276             
277             "<b>Id</b> : " +
278             String.valueOf(Id) +
279             " <br/> " +
280             
281             "<b>From</b> : " +
282             String.valueOf(From) +
283             " <br/> " +
284             
285             "<b>To</b> : " +
286             String.valueOf(To) +
287             " <br/> " +
288             
289             "<b>TraceActors</b> : " +
290             String.valueOf(TraceActors) +
291             " <br/> " +
292              "";
293              }
294 
295              
296              
297              	 public String toMessage() {
298               		StringBuffer buf = new StringBuffer();
299               		buf.append("TRACE");
300               		
301 		    					if (Id != null) {
302 		    						buf.append(" {Id " + Id + "}");
303 		    					}
304 		    				
305                                 if (From != null) {
306                                     buf.append(" {From " +
307                                         From.getX() + "," +
308                                         From.getY() + "," +
309                                         From.getZ() + "}");
310                                 }
311                             
312                                 if (To != null) {
313                                     buf.append(" {To " +
314                                         To.getX() + "," +
315                                         To.getY() + "," +
316                                         To.getZ() + "}");
317                                 }
318                             
319 		    					buf.append(" {TraceActors " + TraceActors + "}");
320 		    				
321             		return buf.toString();
322             }
323              
324              }
325 
326