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