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