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 public class BotDamaged
28 extends InfoMessage
29 implements IWorldEvent, IWorldChangeEvent
30
31 {
32
33
34 public static final String PROTOTYPE =
35 "DAM {Damage 0} {DamageType text} {WeaponName text} {Flaming False} {CausedByWorld False} {DirectDamage False} {BulletHit False} {VehicleHit False} {Instigator unreal_id} ";
36
37
38
39
40
41
42 public BotDamaged()
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
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 public BotDamaged(
115 int Damage, String DamageType, String WeaponName, boolean Flaming, boolean CausedByWorld, boolean DirectDamage, boolean BulletHit, boolean VehicleHit, UnrealId Instigator
116 ) {
117
118 this.Damage = Damage;
119
120 this.DamageType = DamageType;
121
122 this.WeaponName = WeaponName;
123
124 this.Flaming = Flaming;
125
126 this.CausedByWorld = CausedByWorld;
127
128 this.DirectDamage = DirectDamage;
129
130 this.BulletHit = BulletHit;
131
132 this.VehicleHit = VehicleHit;
133
134 this.Instigator = Instigator;
135
136 }
137
138
139
140
141
142
143 public BotDamaged(BotDamaged original) {
144
145 this.Damage = original.getDamage()
146 ;
147
148 this.DamageType = original.getDamageType()
149 ;
150
151 this.WeaponName = original.getWeaponName()
152 ;
153
154 this.Flaming = original.isFlaming()
155 ;
156
157 this.CausedByWorld = original.isCausedByWorld()
158 ;
159
160 this.DirectDamage = original.isDirectDamage()
161 ;
162
163 this.BulletHit = original.isBulletHit()
164 ;
165
166 this.VehicleHit = original.isVehicleHit()
167 ;
168
169 this.Instigator = original.getInstigator()
170 ;
171
172 this.SimTime = original.getSimTime();
173 }
174
175
176 protected long SimTime;
177
178
179
180
181 @Override
182 public long getSimTime() {
183 return SimTime;
184 }
185
186
187
188
189 protected void setSimTime(long SimTime) {
190 this.SimTime = SimTime;
191 }
192
193
194
195
196
197 protected
198 int Damage =
199 0;
200
201
202
203
204 public int getDamage()
205 {
206 return Damage;
207 }
208
209
210
211
212
213
214
215 protected
216 String DamageType =
217 null;
218
219
220
221
222
223
224 public String getDamageType()
225 {
226 return DamageType;
227 }
228
229
230
231
232
233
234
235 protected
236 String WeaponName =
237 null;
238
239
240
241
242
243
244 public String getWeaponName()
245 {
246 return WeaponName;
247 }
248
249
250
251
252
253
254
255 protected
256 boolean Flaming =
257 false;
258
259
260
261
262
263
264 public boolean isFlaming()
265 {
266 return Flaming;
267 }
268
269
270
271
272
273
274
275 protected
276 boolean CausedByWorld =
277 false;
278
279
280
281
282
283
284 public boolean isCausedByWorld()
285 {
286 return CausedByWorld;
287 }
288
289
290
291
292
293
294
295 protected
296 boolean DirectDamage =
297 false;
298
299
300
301
302
303
304 public boolean isDirectDamage()
305 {
306 return DirectDamage;
307 }
308
309
310
311
312
313
314
315 protected
316 boolean BulletHit =
317 false;
318
319
320
321
322
323
324 public boolean isBulletHit()
325 {
326 return BulletHit;
327 }
328
329
330
331
332
333
334
335 protected
336 boolean VehicleHit =
337 false;
338
339
340
341
342
343
344 public boolean isVehicleHit()
345 {
346 return VehicleHit;
347 }
348
349
350
351
352
353
354
355
356 protected
357 UnrealId Instigator =
358 null;
359
360
361
362
363
364
365
366 public UnrealId getInstigator()
367 {
368 return Instigator;
369 }
370
371
372 public String toString() {
373 return
374 super.toString() + "[" +
375
376 "Damage = " + String.valueOf(getDamage()
377 ) + " | " +
378
379 "DamageType = " + String.valueOf(getDamageType()
380 ) + " | " +
381
382 "WeaponName = " + String.valueOf(getWeaponName()
383 ) + " | " +
384
385 "Flaming = " + String.valueOf(isFlaming()
386 ) + " | " +
387
388 "CausedByWorld = " + String.valueOf(isCausedByWorld()
389 ) + " | " +
390
391 "DirectDamage = " + String.valueOf(isDirectDamage()
392 ) + " | " +
393
394 "BulletHit = " + String.valueOf(isBulletHit()
395 ) + " | " +
396
397 "VehicleHit = " + String.valueOf(isVehicleHit()
398 ) + " | " +
399
400 "Instigator = " + String.valueOf(getInstigator()
401 ) + " | " +
402
403 "]";
404 }
405
406
407 public String toHtmlString() {
408 return super.toString() + "[<br/>" +
409
410 "<b>Damage</b> = " + String.valueOf(getDamage()
411 ) + " <br/> " +
412
413 "<b>DamageType</b> = " + String.valueOf(getDamageType()
414 ) + " <br/> " +
415
416 "<b>WeaponName</b> = " + String.valueOf(getWeaponName()
417 ) + " <br/> " +
418
419 "<b>Flaming</b> = " + String.valueOf(isFlaming()
420 ) + " <br/> " +
421
422 "<b>CausedByWorld</b> = " + String.valueOf(isCausedByWorld()
423 ) + " <br/> " +
424
425 "<b>DirectDamage</b> = " + String.valueOf(isDirectDamage()
426 ) + " <br/> " +
427
428 "<b>BulletHit</b> = " + String.valueOf(isBulletHit()
429 ) + " <br/> " +
430
431 "<b>VehicleHit</b> = " + String.valueOf(isVehicleHit()
432 ) + " <br/> " +
433
434 "<b>Instigator</b> = " + String.valueOf(getInstigator()
435 ) + " <br/> " +
436
437 "<br/>]";
438 }
439
440 public String toJsonLiteral() {
441 return "BotDamaged(null, "
442
443 + ")";
444 }
445
446
447
448
449
450
451
452
453
454
455 }
456