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 CONF.
15 *
16 *
17 Configures various attributes of the observer. You can include several of the parameters.
18 The state of options you don't specify will remain unchanged.
19
20 */
21 public class ConfigurationObserver
22 extends CommandMessage
23 {
24
25
26 /** Example how the message looks like - used during parser tests. */
27 public static final String PROTOTYPE =
28 " {UpdateTime 0} {Update 0} {Game False} {Self False} {See False} {Special False} {All False} {Async False} ";
29
30 /**
31 * Creates new instance of command ConfigurationObserver.
32 *
33 Configures various attributes of the observer. You can include several of the parameters.
34 The state of options you don't specify will remain unchanged.
35
36 * Corresponding GameBots message for this command is
37 * CONF.
38 *
39 *
40 * @param UpdateTime
41 The frequency (in seconds) you will receive updates from the observer.
42
43 * @param Update
44 The frequency (in seconds) you will receive updates from the observer. Same as UpdateTime.
45
46 * @param Game
47 Whether to send game-related messages with every update.
48 Affects the following messages: NFO, PLR.
49
50 * @param Self
51 Whether to send messages about the observed player with every update.
52 Affects the following messages: SLF, MYINV.
53
54 * @param See
55 Whether to send messages about what the observed player sees with every update.
56 Affects the following messages: PLR, INV, NAV, MOV, PRJ, VEH.
57
58 * @param Special
59 Whether to send messages about special objects on the map with every update.
60 Affects the following messages: FLG, BOM, DOM.
61
62 * @param All
63 Toggles sending all messages with every update.
64 You can still receive the messages by asking for them using the commands GAME, SELF, SEE, SPECIAL and ALL.
65
66 * @param Async
67 Whether to send asynchronous messages, such as HIT or AIN.
68 Note that if you turn this off you will not be able to receive these messages at all.
69
70 */
71 public ConfigurationObserver(
72 Double UpdateTime, Double Update, Boolean Game, Boolean Self, Boolean See, Boolean Special, Boolean All, Boolean Async
73 ) {
74
75 this.UpdateTime = UpdateTime;
76
77 this.Update = Update;
78
79 this.Game = Game;
80
81 this.Self = Self;
82
83 this.See = See;
84
85 this.Special = Special;
86
87 this.All = All;
88
89 this.Async = Async;
90
91 }
92
93
94 /**
95 * Creates new instance of command ConfigurationObserver.
96 *
97 Configures various attributes of the observer. You can include several of the parameters.
98 The state of options you don't specify will remain unchanged.
99
100 * Corresponding GameBots message for this command is
101 * CONF.
102 * <p></p>
103 * WARNING: this is empty-command constructor, you have to use setters to fill it up with data that should be sent to GameBots2004!
104 */
105 public ConfigurationObserver() {
106 }
107
108
109 /**
110 * Cloning constructor.
111 *
112 * @param original
113 */
114 public ConfigurationObserver(ConfigurationObserver original) {
115
116 this.UpdateTime = original.UpdateTime;
117
118 this.Update = original.Update;
119
120 this.Game = original.Game;
121
122 this.Self = original.Self;
123
124 this.See = original.See;
125
126 this.Special = original.Special;
127
128 this.All = original.All;
129
130 this.Async = original.Async;
131
132 }
133
134 /**
135
136 The frequency (in seconds) you will receive updates from the observer.
137
138 */
139 protected
140 Double UpdateTime =
141
142 null
143 ;
144
145
146
147 /**
148 *
149 The frequency (in seconds) you will receive updates from the observer.
150
151 */
152 public Double getUpdateTime()
153
154 {
155 return
156 UpdateTime;
157 }
158
159
160
161
162 /**
163 *
164 The frequency (in seconds) you will receive updates from the observer.
165
166 */
167 public ConfigurationObserver
168 setUpdateTime(Double UpdateTime)
169
170 {
171 this.UpdateTime = UpdateTime;
172 return this;
173 }
174
175 /**
176
177 The frequency (in seconds) you will receive updates from the observer. Same as UpdateTime.
178
179 */
180 protected
181 Double Update =
182
183 null
184 ;
185
186
187
188 /**
189 *
190 The frequency (in seconds) you will receive updates from the observer. Same as UpdateTime.
191
192 */
193 public Double getUpdate()
194
195 {
196 return
197 Update;
198 }
199
200
201
202
203 /**
204 *
205 The frequency (in seconds) you will receive updates from the observer. Same as UpdateTime.
206
207 */
208 public ConfigurationObserver
209 setUpdate(Double Update)
210
211 {
212 this.Update = Update;
213 return this;
214 }
215
216 /**
217
218 Whether to send game-related messages with every update.
219 Affects the following messages: NFO, PLR.
220
221 */
222 protected
223 Boolean Game =
224
225 null
226 ;
227
228
229
230 /**
231 *
232 Whether to send game-related messages with every update.
233 Affects the following messages: NFO, PLR.
234
235 */
236 public Boolean isGame()
237
238 {
239 return
240 Game;
241 }
242
243
244
245
246 /**
247 *
248 Whether to send game-related messages with every update.
249 Affects the following messages: NFO, PLR.
250
251 */
252 public ConfigurationObserver
253 setGame(Boolean Game)
254
255 {
256 this.Game = Game;
257 return this;
258 }
259
260 /**
261
262 Whether to send messages about the observed player with every update.
263 Affects the following messages: SLF, MYINV.
264
265 */
266 protected
267 Boolean Self =
268
269 null
270 ;
271
272
273
274 /**
275 *
276 Whether to send messages about the observed player with every update.
277 Affects the following messages: SLF, MYINV.
278
279 */
280 public Boolean isSelf()
281
282 {
283 return
284 Self;
285 }
286
287
288
289
290 /**
291 *
292 Whether to send messages about the observed player with every update.
293 Affects the following messages: SLF, MYINV.
294
295 */
296 public ConfigurationObserver
297 setSelf(Boolean Self)
298
299 {
300 this.Self = Self;
301 return this;
302 }
303
304 /**
305
306 Whether to send messages about what the observed player sees with every update.
307 Affects the following messages: PLR, INV, NAV, MOV, PRJ, VEH.
308
309 */
310 protected
311 Boolean See =
312
313 null
314 ;
315
316
317
318 /**
319 *
320 Whether to send messages about what the observed player sees with every update.
321 Affects the following messages: PLR, INV, NAV, MOV, PRJ, VEH.
322
323 */
324 public Boolean isSee()
325
326 {
327 return
328 See;
329 }
330
331
332
333
334 /**
335 *
336 Whether to send messages about what the observed player sees with every update.
337 Affects the following messages: PLR, INV, NAV, MOV, PRJ, VEH.
338
339 */
340 public ConfigurationObserver
341 setSee(Boolean See)
342
343 {
344 this.See = See;
345 return this;
346 }
347
348 /**
349
350 Whether to send messages about special objects on the map with every update.
351 Affects the following messages: FLG, BOM, DOM.
352
353 */
354 protected
355 Boolean Special =
356
357 null
358 ;
359
360
361
362 /**
363 *
364 Whether to send messages about special objects on the map with every update.
365 Affects the following messages: FLG, BOM, DOM.
366
367 */
368 public Boolean isSpecial()
369
370 {
371 return
372 Special;
373 }
374
375
376
377
378 /**
379 *
380 Whether to send messages about special objects on the map with every update.
381 Affects the following messages: FLG, BOM, DOM.
382
383 */
384 public ConfigurationObserver
385 setSpecial(Boolean Special)
386
387 {
388 this.Special = Special;
389 return this;
390 }
391
392 /**
393
394 Toggles sending all messages with every update.
395 You can still receive the messages by asking for them using the commands GAME, SELF, SEE, SPECIAL and ALL.
396
397 */
398 protected
399 Boolean All =
400
401 null
402 ;
403
404
405
406 /**
407 *
408 Toggles sending all messages with every update.
409 You can still receive the messages by asking for them using the commands GAME, SELF, SEE, SPECIAL and ALL.
410
411 */
412 public Boolean isAll()
413
414 {
415 return
416 All;
417 }
418
419
420
421
422 /**
423 *
424 Toggles sending all messages with every update.
425 You can still receive the messages by asking for them using the commands GAME, SELF, SEE, SPECIAL and ALL.
426
427 */
428 public ConfigurationObserver
429 setAll(Boolean All)
430
431 {
432 this.All = All;
433 return this;
434 }
435
436 /**
437
438 Whether to send asynchronous messages, such as HIT or AIN.
439 Note that if you turn this off you will not be able to receive these messages at all.
440
441 */
442 protected
443 Boolean Async =
444
445 null
446 ;
447
448
449
450 /**
451 *
452 Whether to send asynchronous messages, such as HIT or AIN.
453 Note that if you turn this off you will not be able to receive these messages at all.
454
455 */
456 public Boolean isAsync()
457
458 {
459 return
460 Async;
461 }
462
463
464
465
466 /**
467 *
468 Whether to send asynchronous messages, such as HIT or AIN.
469 Note that if you turn this off you will not be able to receive these messages at all.
470
471 */
472 public ConfigurationObserver
473 setAsync(Boolean Async)
474
475 {
476 this.Async = Async;
477 return this;
478 }
479
480 public String toString() {
481 return toMessage();
482 }
483
484 public String toHtmlString() {
485 return super.toString() + "[<br/>" +
486
487 "<b>UpdateTime</b> = " +
488 String.valueOf(getUpdateTime()
489 ) +
490 " <br/> " +
491
492 "<b>Update</b> = " +
493 String.valueOf(getUpdate()
494 ) +
495 " <br/> " +
496
497 "<b>Game</b> = " +
498 String.valueOf(isGame()
499 ) +
500 " <br/> " +
501
502 "<b>Self</b> = " +
503 String.valueOf(isSelf()
504 ) +
505 " <br/> " +
506
507 "<b>See</b> = " +
508 String.valueOf(isSee()
509 ) +
510 " <br/> " +
511
512 "<b>Special</b> = " +
513 String.valueOf(isSpecial()
514 ) +
515 " <br/> " +
516
517 "<b>All</b> = " +
518 String.valueOf(isAll()
519 ) +
520 " <br/> " +
521
522 "<b>Async</b> = " +
523 String.valueOf(isAsync()
524 ) +
525 " <br/> " +
526
527 "<br/>]"
528 ;
529 }
530
531 public String toMessage() {
532 StringBuffer buf = new StringBuffer();
533 buf.append("CONF");
534
535 if (UpdateTime != null) {
536 buf.append(" {UpdateTime " + UpdateTime + "}");
537 }
538
539 if (Update != null) {
540 buf.append(" {Update " + Update + "}");
541 }
542
543 if (Game != null) {
544 buf.append(" {Game " + Game + "}");
545 }
546
547 if (Self != null) {
548 buf.append(" {Self " + Self + "}");
549 }
550
551 if (See != null) {
552 buf.append(" {See " + See + "}");
553 }
554
555 if (Special != null) {
556 buf.append(" {Special " + Special + "}");
557 }
558
559 if (All != null) {
560 buf.append(" {All " + All + "}");
561 }
562
563 if (Async != null) {
564 buf.append(" {Async " + Async + "}");
565 }
566
567 return buf.toString();
568 }
569
570 // --- Extra Java from XML BEGIN (extra/code/java)
571
572 // --- Extra Java from XML END (extra/code/java)
573
574 }
575