1
2
3
4
5
6
7
8
9
10
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
15
16
17
18
19
20
21 public class ConfigurationObserver
22 extends CommandMessage
23 {
24
25
26
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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
96
97
98
99
100
101
102
103
104
105 public ConfigurationObserver() {
106 }
107
108
109
110
111
112
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
137
138
139 protected
140 Double UpdateTime =
141
142 null
143 ;
144
145
146
147
148
149
150
151
152 public Double getUpdateTime()
153
154 {
155 return
156 UpdateTime;
157 }
158
159
160
161
162
163
164
165
166
167 public ConfigurationObserver
168 setUpdateTime(Double UpdateTime)
169
170 {
171 this.UpdateTime = UpdateTime;
172 return this;
173 }
174
175
176
177
178
179
180 protected
181 Double Update =
182
183 null
184 ;
185
186
187
188
189
190
191
192
193 public Double getUpdate()
194
195 {
196 return
197 Update;
198 }
199
200
201
202
203
204
205
206
207
208 public ConfigurationObserver
209 setUpdate(Double Update)
210
211 {
212 this.Update = Update;
213 return this;
214 }
215
216
217
218
219
220
221
222 protected
223 Boolean Game =
224
225 null
226 ;
227
228
229
230
231
232
233
234
235
236 public Boolean isGame()
237
238 {
239 return
240 Game;
241 }
242
243
244
245
246
247
248
249
250
251
252 public ConfigurationObserver
253 setGame(Boolean Game)
254
255 {
256 this.Game = Game;
257 return this;
258 }
259
260
261
262
263
264
265
266 protected
267 Boolean Self =
268
269 null
270 ;
271
272
273
274
275
276
277
278
279
280 public Boolean isSelf()
281
282 {
283 return
284 Self;
285 }
286
287
288
289
290
291
292
293
294
295
296 public ConfigurationObserver
297 setSelf(Boolean Self)
298
299 {
300 this.Self = Self;
301 return this;
302 }
303
304
305
306
307
308
309
310 protected
311 Boolean See =
312
313 null
314 ;
315
316
317
318
319
320
321
322
323
324 public Boolean isSee()
325
326 {
327 return
328 See;
329 }
330
331
332
333
334
335
336
337
338
339
340 public ConfigurationObserver
341 setSee(Boolean See)
342
343 {
344 this.See = See;
345 return this;
346 }
347
348
349
350
351
352
353
354 protected
355 Boolean Special =
356
357 null
358 ;
359
360
361
362
363
364
365
366
367
368 public Boolean isSpecial()
369
370 {
371 return
372 Special;
373 }
374
375
376
377
378
379
380
381
382
383
384 public ConfigurationObserver
385 setSpecial(Boolean Special)
386
387 {
388 this.Special = Special;
389 return this;
390 }
391
392
393
394
395
396
397
398 protected
399 Boolean All =
400
401 null
402 ;
403
404
405
406
407
408
409
410
411
412 public Boolean isAll()
413
414 {
415 return
416 All;
417 }
418
419
420
421
422
423
424
425
426
427
428 public ConfigurationObserver
429 setAll(Boolean All)
430
431 {
432 this.All = All;
433 return this;
434 }
435
436
437
438
439
440
441
442 protected
443 Boolean Async =
444
445 null
446 ;
447
448
449
450
451
452
453
454
455
456 public Boolean isAsync()
457
458 {
459 return
460 Async;
461 }
462
463
464
465
466
467
468
469
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
571
572
573
574 }
575