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 Asynchronous message. Some part of the bot body changed the
35 zone.
36
37 Corresponding GameBots message is
38 VCH.
39
40 */
41
42 public class
43 VolumeChanged
44 extends GBEvent
45
46 implements IWorldEvent, IWorldChangeEvent
47
48 {
49
50 /**
51 Creates new instance of command VolumeChanged.
52
53 Asynchronous message. Some part of the bot body changed the
54 zone.
55 Corresponding GameBots message for this command is
56 .
57 @param Id Id of the zone entered.
58 @param ZoneVelocity
59 Zone velocity (?).
60
61 @param ZoneGravity
62 Gravity in this zone.
63
64 @param GroundFriction
65 Friction of the floor.
66
67 @param FluidFriction
68 Friction of the fluid.
69
70 @param TerminalVelocity
71 Terminal velocity (?).
72
73 @param WaterVolume
74 If this zone is a water.
75
76 @param PainCausing
77 True or false if we get some damage when we stay in this
78 zone.
79
80 @param Destructive
81 If this zone kills most of the actors instantly.
82
83 @param DamagePerSec
84 Amount of damage we will suffer per second if we stay in this zone.
85
86 @param DamageType
87 Type of the damage in this zone.
88
89 @param NoInventory
90 If the inventory is allowed here.
91
92 @param MoveProjectiles
93 If this velocity zone should impart velocity to projectiles and effects.
94
95 @param NeutralZone
96 Players can't take damage in this zone.
97
98 */
99 public VolumeChanged(
100 String Id, Velocity ZoneVelocity, Velocity ZoneGravity, double GroundFriction, double FluidFriction, double TerminalVelocity, boolean WaterVolume, boolean PainCausing, boolean Destructive, double DamagePerSec, String DamageType, boolean NoInventory, boolean MoveProjectiles, boolean NeutralZone) {
101
102 this.Id = Id;
103
104 this.ZoneVelocity = ZoneVelocity;
105
106 this.ZoneGravity = ZoneGravity;
107
108 this.GroundFriction = GroundFriction;
109
110 this.FluidFriction = FluidFriction;
111
112 this.TerminalVelocity = TerminalVelocity;
113
114 this.WaterVolume = WaterVolume;
115
116 this.PainCausing = PainCausing;
117
118 this.Destructive = Destructive;
119
120 this.DamagePerSec = DamagePerSec;
121
122 this.DamageType = DamageType;
123
124 this.NoInventory = NoInventory;
125
126 this.MoveProjectiles = MoveProjectiles;
127
128 this.NeutralZone = NeutralZone;
129
130 }
131
132
133 /** Example how the message looks like - used during parser tests. */
134 public static final String PROTOTYPE =
135 "VCH {Id text} {ZoneVelocity 0,0,0} {ZoneGravity 0,0,0} {GroundFriction 0} {FluidFriction 0} {TerminalVelocity 0} {WaterVolume False} {PainCausing False} {Destructive False} {DamagePerSec 0} {DamageType text} {NoInventory False} {MoveProjectiles False} {NeutralZone False}";
136
137
138 /////// Properties BEGIN
139
140 /**
141 Id of the zone entered. */
142 protected
143 String Id =
144 null;
145
146
147 /**
148 Id of the zone entered. */
149 public
150 String getId() {
151 return
152 Id;
153 }
154
155
156
157 /**
158
159 Zone velocity (?).
160 */
161 protected
162 Velocity ZoneVelocity =
163 null;
164
165
166 /**
167
168 Zone velocity (?).
169 */
170 public
171 Velocity getZoneVelocity() {
172 return
173 ZoneVelocity;
174 }
175
176
177
178 /**
179
180 Gravity in this zone.
181 */
182 protected
183 Velocity ZoneGravity =
184 null;
185
186
187 /**
188
189 Gravity in this zone.
190 */
191 public
192 Velocity getZoneGravity() {
193 return
194 ZoneGravity;
195 }
196
197
198
199 /**
200
201 Friction of the floor.
202 */
203 protected
204 double GroundFriction =
205 0;
206
207
208 /**
209
210 Friction of the floor.
211 */
212 public
213 double getGroundFriction() {
214 return
215 GroundFriction;
216 }
217
218
219
220 /**
221
222 Friction of the fluid.
223 */
224 protected
225 double FluidFriction =
226 0;
227
228
229 /**
230
231 Friction of the fluid.
232 */
233 public
234 double getFluidFriction() {
235 return
236 FluidFriction;
237 }
238
239
240
241 /**
242
243 Terminal velocity (?).
244 */
245 protected
246 double TerminalVelocity =
247 0;
248
249
250 /**
251
252 Terminal velocity (?).
253 */
254 public
255 double getTerminalVelocity() {
256 return
257 TerminalVelocity;
258 }
259
260
261
262 /**
263
264 If this zone is a water.
265 */
266 protected
267 boolean WaterVolume =
268 false;
269
270
271 /**
272
273 If this zone is a water.
274 */
275 public
276 boolean isWaterVolume() {
277 return
278 WaterVolume;
279 }
280
281
282
283 /**
284
285 True or false if we get some damage when we stay in this
286 zone.
287 */
288 protected
289 boolean PainCausing =
290 false;
291
292
293 /**
294
295 True or false if we get some damage when we stay in this
296 zone.
297 */
298 public
299 boolean isPainCausing() {
300 return
301 PainCausing;
302 }
303
304
305
306 /**
307
308 If this zone kills most of the actors instantly.
309 */
310 protected
311 boolean Destructive =
312 false;
313
314
315 /**
316
317 If this zone kills most of the actors instantly.
318 */
319 public
320 boolean isDestructive() {
321 return
322 Destructive;
323 }
324
325
326
327 /**
328
329 Amount of damage we will suffer per second if we stay in this zone.
330 */
331 protected
332 double DamagePerSec =
333 0;
334
335
336 /**
337
338 Amount of damage we will suffer per second if we stay in this zone.
339 */
340 public
341 double getDamagePerSec() {
342 return
343 DamagePerSec;
344 }
345
346
347
348 /**
349
350 Type of the damage in this zone.
351 */
352 protected
353 String DamageType =
354 null;
355
356
357 /**
358
359 Type of the damage in this zone.
360 */
361 public
362 String getDamageType() {
363 return
364 DamageType;
365 }
366
367
368
369 /**
370
371 If the inventory is allowed here.
372 */
373 protected
374 boolean NoInventory =
375 false;
376
377
378 /**
379
380 If the inventory is allowed here.
381 */
382 public
383 boolean isNoInventory() {
384 return
385 NoInventory;
386 }
387
388
389
390 /**
391
392 If this velocity zone should impart velocity to projectiles and effects.
393 */
394 protected
395 boolean MoveProjectiles =
396 false;
397
398
399 /**
400
401 If this velocity zone should impart velocity to projectiles and effects.
402 */
403 public
404 boolean isMoveProjectiles() {
405 return
406 MoveProjectiles;
407 }
408
409
410
411 /**
412
413 Players can't take damage in this zone.
414 */
415 protected
416 boolean NeutralZone =
417 false;
418
419
420 /**
421
422 Players can't take damage in this zone.
423 */
424 public
425 boolean isNeutralZone() {
426 return
427 NeutralZone;
428 }
429
430
431
432 /////// Properties END
433
434 /////// Extra Java code BEGIN
435
436 /////// Additional code from xslt BEGIN
437
438 public long getSimTime() {
439 // NOT IMPLEMENTED FOR UDK
440 return 0;
441 }
442
443
444
445 /////// Additional code from xslt END
446
447 /////// Extra Java from XML BEGIN
448
449 /////// Extra Java from XML END
450
451 /////// Extra Java code END
452
453
454
455 /**
456 * Cloning constructor.
457 */
458 public VolumeChanged(VolumeChanged original) {
459
460 this.Id=original.Id;
461
462 this.ZoneVelocity=original.ZoneVelocity;
463
464 this.ZoneGravity=original.ZoneGravity;
465
466 this.GroundFriction=original.GroundFriction;
467
468 this.FluidFriction=original.FluidFriction;
469
470 this.TerminalVelocity=original.TerminalVelocity;
471
472 this.WaterVolume=original.WaterVolume;
473
474 this.PainCausing=original.PainCausing;
475
476 this.Destructive=original.Destructive;
477
478 this.DamagePerSec=original.DamagePerSec;
479
480 this.DamageType=original.DamageType;
481
482 this.NoInventory=original.NoInventory;
483
484 this.MoveProjectiles=original.MoveProjectiles;
485
486 this.NeutralZone=original.NeutralZone;
487
488 }
489
490
491 /**
492 * Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
493 */
494 public VolumeChanged() {
495 }
496
497
498
499 public String toString() {
500 return
501
502 super.toString() + " | " +
503
504 "Id = " +
505 String.valueOf(Id) + " | " +
506
507 "ZoneVelocity = " +
508 String.valueOf(ZoneVelocity) + " | " +
509
510 "ZoneGravity = " +
511 String.valueOf(ZoneGravity) + " | " +
512
513 "GroundFriction = " +
514 String.valueOf(GroundFriction) + " | " +
515
516 "FluidFriction = " +
517 String.valueOf(FluidFriction) + " | " +
518
519 "TerminalVelocity = " +
520 String.valueOf(TerminalVelocity) + " | " +
521
522 "WaterVolume = " +
523 String.valueOf(WaterVolume) + " | " +
524
525 "PainCausing = " +
526 String.valueOf(PainCausing) + " | " +
527
528 "Destructive = " +
529 String.valueOf(Destructive) + " | " +
530
531 "DamagePerSec = " +
532 String.valueOf(DamagePerSec) + " | " +
533
534 "DamageType = " +
535 String.valueOf(DamageType) + " | " +
536
537 "NoInventory = " +
538 String.valueOf(NoInventory) + " | " +
539
540 "MoveProjectiles = " +
541 String.valueOf(MoveProjectiles) + " | " +
542
543 "NeutralZone = " +
544 String.valueOf(NeutralZone) + " | " +
545 "";
546
547 }
548
549 public String toHtmlString() {
550 return super.toString() +
551
552 "<b>Id</b> : " +
553 String.valueOf(Id) +
554 " <br/> " +
555
556 "<b>ZoneVelocity</b> : " +
557 String.valueOf(ZoneVelocity) +
558 " <br/> " +
559
560 "<b>ZoneGravity</b> : " +
561 String.valueOf(ZoneGravity) +
562 " <br/> " +
563
564 "<b>GroundFriction</b> : " +
565 String.valueOf(GroundFriction) +
566 " <br/> " +
567
568 "<b>FluidFriction</b> : " +
569 String.valueOf(FluidFriction) +
570 " <br/> " +
571
572 "<b>TerminalVelocity</b> : " +
573 String.valueOf(TerminalVelocity) +
574 " <br/> " +
575
576 "<b>WaterVolume</b> : " +
577 String.valueOf(WaterVolume) +
578 " <br/> " +
579
580 "<b>PainCausing</b> : " +
581 String.valueOf(PainCausing) +
582 " <br/> " +
583
584 "<b>Destructive</b> : " +
585 String.valueOf(Destructive) +
586 " <br/> " +
587
588 "<b>DamagePerSec</b> : " +
589 String.valueOf(DamagePerSec) +
590 " <br/> " +
591
592 "<b>DamageType</b> : " +
593 String.valueOf(DamageType) +
594 " <br/> " +
595
596 "<b>NoInventory</b> : " +
597 String.valueOf(NoInventory) +
598 " <br/> " +
599
600 "<b>MoveProjectiles</b> : " +
601 String.valueOf(MoveProjectiles) +
602 " <br/> " +
603
604 "<b>NeutralZone</b> : " +
605 String.valueOf(NeutralZone) +
606 " <br/> " +
607 "";
608 }
609
610
611
612 }
613
614