1 package cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages;
2
3
4 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.*;
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 public class VolumeChanged
29 extends InfoMessage
30 implements IWorldEvent, IWorldChangeEvent
31
32 {
33
34
35 public static final String PROTOTYPE =
36 "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} ";
37
38
39
40
41
42
43 public VolumeChanged()
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146 public VolumeChanged(
147 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
148 ) {
149
150 this.Id = Id;
151
152 this.ZoneVelocity = ZoneVelocity;
153
154 this.ZoneGravity = ZoneGravity;
155
156 this.GroundFriction = GroundFriction;
157
158 this.FluidFriction = FluidFriction;
159
160 this.TerminalVelocity = TerminalVelocity;
161
162 this.WaterVolume = WaterVolume;
163
164 this.PainCausing = PainCausing;
165
166 this.Destructive = Destructive;
167
168 this.DamagePerSec = DamagePerSec;
169
170 this.DamageType = DamageType;
171
172 this.NoInventory = NoInventory;
173
174 this.MoveProjectiles = MoveProjectiles;
175
176 this.NeutralZone = NeutralZone;
177
178 }
179
180
181
182
183
184
185 public VolumeChanged(VolumeChanged original) {
186
187 this.Id = original.getId()
188 ;
189
190 this.ZoneVelocity = original.getZoneVelocity()
191 ;
192
193 this.ZoneGravity = original.getZoneGravity()
194 ;
195
196 this.GroundFriction = original.getGroundFriction()
197 ;
198
199 this.FluidFriction = original.getFluidFriction()
200 ;
201
202 this.TerminalVelocity = original.getTerminalVelocity()
203 ;
204
205 this.WaterVolume = original.isWaterVolume()
206 ;
207
208 this.PainCausing = original.isPainCausing()
209 ;
210
211 this.Destructive = original.isDestructive()
212 ;
213
214 this.DamagePerSec = original.getDamagePerSec()
215 ;
216
217 this.DamageType = original.getDamageType()
218 ;
219
220 this.NoInventory = original.isNoInventory()
221 ;
222
223 this.MoveProjectiles = original.isMoveProjectiles()
224 ;
225
226 this.NeutralZone = original.isNeutralZone()
227 ;
228
229 this.SimTime = original.getSimTime();
230 }
231
232
233 protected long SimTime;
234
235
236
237
238 @Override
239 public long getSimTime() {
240 return SimTime;
241 }
242
243
244
245
246 protected void setSimTime(long SimTime) {
247 this.SimTime = SimTime;
248 }
249
250
251
252
253
254 protected
255 String Id =
256 null;
257
258
259
260
261 public String getId()
262 {
263 return Id;
264 }
265
266
267
268
269
270
271
272 protected
273 Velocity ZoneVelocity =
274 null;
275
276
277
278
279
280
281 public Velocity getZoneVelocity()
282 {
283 return ZoneVelocity;
284 }
285
286
287
288
289
290
291
292 protected
293 Velocity ZoneGravity =
294 null;
295
296
297
298
299
300
301 public Velocity getZoneGravity()
302 {
303 return ZoneGravity;
304 }
305
306
307
308
309
310
311
312 protected
313 double GroundFriction =
314 0;
315
316
317
318
319
320
321 public double getGroundFriction()
322 {
323 return GroundFriction;
324 }
325
326
327
328
329
330
331
332 protected
333 double FluidFriction =
334 0;
335
336
337
338
339
340
341 public double getFluidFriction()
342 {
343 return FluidFriction;
344 }
345
346
347
348
349
350
351
352 protected
353 double TerminalVelocity =
354 0;
355
356
357
358
359
360
361 public double getTerminalVelocity()
362 {
363 return TerminalVelocity;
364 }
365
366
367
368
369
370
371
372 protected
373 boolean WaterVolume =
374 false;
375
376
377
378
379
380
381 public boolean isWaterVolume()
382 {
383 return WaterVolume;
384 }
385
386
387
388
389
390
391
392
393 protected
394 boolean PainCausing =
395 false;
396
397
398
399
400
401
402
403 public boolean isPainCausing()
404 {
405 return PainCausing;
406 }
407
408
409
410
411
412
413
414 protected
415 boolean Destructive =
416 false;
417
418
419
420
421
422
423 public boolean isDestructive()
424 {
425 return Destructive;
426 }
427
428
429
430
431
432
433
434 protected
435 double DamagePerSec =
436 0;
437
438
439
440
441
442
443 public double getDamagePerSec()
444 {
445 return DamagePerSec;
446 }
447
448
449
450
451
452
453
454 protected
455 String DamageType =
456 null;
457
458
459
460
461
462
463 public String getDamageType()
464 {
465 return DamageType;
466 }
467
468
469
470
471
472
473
474 protected
475 boolean NoInventory =
476 false;
477
478
479
480
481
482
483 public boolean isNoInventory()
484 {
485 return NoInventory;
486 }
487
488
489
490
491
492
493
494 protected
495 boolean MoveProjectiles =
496 false;
497
498
499
500
501
502
503 public boolean isMoveProjectiles()
504 {
505 return MoveProjectiles;
506 }
507
508
509
510
511
512
513
514 protected
515 boolean NeutralZone =
516 false;
517
518
519
520
521
522
523 public boolean isNeutralZone()
524 {
525 return NeutralZone;
526 }
527
528
529 public String toString() {
530 return
531 super.toString() + "[" +
532
533 "Id = " + String.valueOf(getId()
534 ) + " | " +
535
536 "ZoneVelocity = " + String.valueOf(getZoneVelocity()
537 ) + " | " +
538
539 "ZoneGravity = " + String.valueOf(getZoneGravity()
540 ) + " | " +
541
542 "GroundFriction = " + String.valueOf(getGroundFriction()
543 ) + " | " +
544
545 "FluidFriction = " + String.valueOf(getFluidFriction()
546 ) + " | " +
547
548 "TerminalVelocity = " + String.valueOf(getTerminalVelocity()
549 ) + " | " +
550
551 "WaterVolume = " + String.valueOf(isWaterVolume()
552 ) + " | " +
553
554 "PainCausing = " + String.valueOf(isPainCausing()
555 ) + " | " +
556
557 "Destructive = " + String.valueOf(isDestructive()
558 ) + " | " +
559
560 "DamagePerSec = " + String.valueOf(getDamagePerSec()
561 ) + " | " +
562
563 "DamageType = " + String.valueOf(getDamageType()
564 ) + " | " +
565
566 "NoInventory = " + String.valueOf(isNoInventory()
567 ) + " | " +
568
569 "MoveProjectiles = " + String.valueOf(isMoveProjectiles()
570 ) + " | " +
571
572 "NeutralZone = " + String.valueOf(isNeutralZone()
573 ) + " | " +
574
575 "]";
576 }
577
578
579 public String toHtmlString() {
580 return super.toString() + "[<br/>" +
581
582 "<b>Id</b> = " + String.valueOf(getId()
583 ) + " <br/> " +
584
585 "<b>ZoneVelocity</b> = " + String.valueOf(getZoneVelocity()
586 ) + " <br/> " +
587
588 "<b>ZoneGravity</b> = " + String.valueOf(getZoneGravity()
589 ) + " <br/> " +
590
591 "<b>GroundFriction</b> = " + String.valueOf(getGroundFriction()
592 ) + " <br/> " +
593
594 "<b>FluidFriction</b> = " + String.valueOf(getFluidFriction()
595 ) + " <br/> " +
596
597 "<b>TerminalVelocity</b> = " + String.valueOf(getTerminalVelocity()
598 ) + " <br/> " +
599
600 "<b>WaterVolume</b> = " + String.valueOf(isWaterVolume()
601 ) + " <br/> " +
602
603 "<b>PainCausing</b> = " + String.valueOf(isPainCausing()
604 ) + " <br/> " +
605
606 "<b>Destructive</b> = " + String.valueOf(isDestructive()
607 ) + " <br/> " +
608
609 "<b>DamagePerSec</b> = " + String.valueOf(getDamagePerSec()
610 ) + " <br/> " +
611
612 "<b>DamageType</b> = " + String.valueOf(getDamageType()
613 ) + " <br/> " +
614
615 "<b>NoInventory</b> = " + String.valueOf(isNoInventory()
616 ) + " <br/> " +
617
618 "<b>MoveProjectiles</b> = " + String.valueOf(isMoveProjectiles()
619 ) + " <br/> " +
620
621 "<b>NeutralZone</b> = " + String.valueOf(isNeutralZone()
622 ) + " <br/> " +
623
624 "<br/>]";
625 }
626
627 public String toJsonLiteral() {
628 return "VolumeChanged(null, "
629
630 + ")";
631 }
632
633
634
635
636
637
638
639
640
641
642 }
643