View Javadoc

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 other player died - reporting his
35  		death. Additional information about DamageType - DeathString and so are exported just if we can see the dying player.
36  	
37                            Corresponding GameBots message is
38                            KIL.
39                        
40               */
41              
42              public class
43              PlayerKilled
44                      extends GBEvent
45                  
46  	            	implements IWorldEvent, IWorldChangeEvent
47  
48              {
49              
50              /**
51                Creates new instance of command PlayerKilled.
52                
53  		Asynchronous message. Some other player died - reporting his
54  		death. Additional information about DamageType - DeathString and so are exported just if we can see the dying player.
55  	Corresponding GameBots message for this command is
56                .
57                    @param Id Unique Id of the dead player.
58                    @param Killer 
59  			Unique Id of player that killed if any (the victim might
60  			have walked off a ledge).
61  		
62                    @param KilledPawn 
63  			The UT Pawn that was killed - support for vehicles. If someone destroyes vehicle
64  			we will get it here (Id will be none and in KilledPawn we will have destroyed vehicle).
65  		
66                    @param DamageType 
67  			A string describing what kind of damage killed the victim.
68  		
69                    @param DeathString 
70  			String describing this type of death.
71  		
72                    @param WeaponName 
73  			Name of the weapon that caused this damage.
74  		
75                    @param Flaming 
76  			If this damage is causing our bot to burn. TODO
77  		
78                    @param CausedByWorld 
79  			If this damage was caused by world - falling into lava, or falling down.
80  		
81                    @param DirectDamage 
82  			If the damage is direct. TODO
83  		
84                    @param BulletHit 
85  			If this damage was caused by bullet.
86  		
87                    @param VehicleHit 
88  			If this damage was caused by vehicle running over us.
89  		
90                */
91               public PlayerKilled(
92                  UnrealId Id,  UnrealId Killer,  String KilledPawn,  String DamageType,  String DeathString,  String WeaponName,  boolean Flaming,  boolean CausedByWorld,  boolean DirectDamage,  boolean BulletHit,  boolean VehicleHit) {
93                      
94                      this.Id = Id;
95                  
96                      this.Killer = Killer;
97                  
98                      this.KilledPawn = KilledPawn;
99                  
100                     this.DamageType = DamageType;
101                 
102                     this.DeathString = DeathString;
103                 
104                     this.WeaponName = WeaponName;
105                 
106                     this.Flaming = Flaming;
107                 
108                     this.CausedByWorld = CausedByWorld;
109                 
110                     this.DirectDamage = DirectDamage;
111                 
112                     this.BulletHit = BulletHit;
113                 
114                     this.VehicleHit = VehicleHit;
115                 
116                 }
117 
118             
119     	/** Example how the message looks like - used during parser tests. */
120     	public static final String PROTOTYPE =
121     		"KIL {Id unreal_id} {Killer unreal_id} {KilledPawn text} {DamageType text} {DeathString text} {WeaponName text} {Flaming False} {CausedByWorld False} {DirectDamage False} {BulletHit False} {VehicleHit False}";
122     
123 
124             /////// Properties BEGIN
125             
126         /**
127         Unique Id of the dead player. */
128         protected
129          UnrealId Id =
130         	null;
131 
132         
133         /**
134         Unique Id of the dead player. */
135         public
136         UnrealId getId() {
137             return
138          Id;
139         }
140         
141 
142         
143         /**
144         
145 			Unique Id of player that killed if any (the victim might
146 			have walked off a ledge).
147 		 */
148         protected
149          UnrealId Killer =
150         	null;
151 
152         
153         /**
154         
155 			Unique Id of player that killed if any (the victim might
156 			have walked off a ledge).
157 		 */
158         public
159         UnrealId getKiller() {
160             return
161          Killer;
162         }
163         
164 
165         
166         /**
167         
168 			The UT Pawn that was killed - support for vehicles. If someone destroyes vehicle
169 			we will get it here (Id will be none and in KilledPawn we will have destroyed vehicle).
170 		 */
171         protected
172          String KilledPawn =
173         	null;
174 
175         
176         /**
177         
178 			The UT Pawn that was killed - support for vehicles. If someone destroyes vehicle
179 			we will get it here (Id will be none and in KilledPawn we will have destroyed vehicle).
180 		 */
181         public
182         String getKilledPawn() {
183             return
184          KilledPawn;
185         }
186         
187 
188         
189         /**
190         
191 			A string describing what kind of damage killed the victim.
192 		 */
193         protected
194          String DamageType =
195         	null;
196 
197         
198         /**
199         
200 			A string describing what kind of damage killed the victim.
201 		 */
202         public
203         String getDamageType() {
204             return
205          DamageType;
206         }
207         
208 
209         
210         /**
211         
212 			String describing this type of death.
213 		 */
214         protected
215          String DeathString =
216         	null;
217 
218         
219         /**
220         
221 			String describing this type of death.
222 		 */
223         public
224         String getDeathString() {
225             return
226          DeathString;
227         }
228         
229 
230         
231         /**
232         
233 			Name of the weapon that caused this damage.
234 		 */
235         protected
236          String WeaponName =
237         	null;
238 
239         
240         /**
241         
242 			Name of the weapon that caused this damage.
243 		 */
244         public
245         String getWeaponName() {
246             return
247          WeaponName;
248         }
249         
250 
251         
252         /**
253         
254 			If this damage is causing our bot to burn. TODO
255 		 */
256         protected
257          boolean Flaming =
258         	false;
259 
260         
261         /**
262         
263 			If this damage is causing our bot to burn. TODO
264 		 */
265         public
266         boolean isFlaming() {
267             return
268          Flaming;
269         }
270         
271 
272         
273         /**
274         
275 			If this damage was caused by world - falling into lava, or falling down.
276 		 */
277         protected
278          boolean CausedByWorld =
279         	false;
280 
281         
282         /**
283         
284 			If this damage was caused by world - falling into lava, or falling down.
285 		 */
286         public
287         boolean isCausedByWorld() {
288             return
289          CausedByWorld;
290         }
291         
292 
293         
294         /**
295         
296 			If the damage is direct. TODO
297 		 */
298         protected
299          boolean DirectDamage =
300         	false;
301 
302         
303         /**
304         
305 			If the damage is direct. TODO
306 		 */
307         public
308         boolean isDirectDamage() {
309             return
310          DirectDamage;
311         }
312         
313 
314         
315         /**
316         
317 			If this damage was caused by bullet.
318 		 */
319         protected
320          boolean BulletHit =
321         	false;
322 
323         
324         /**
325         
326 			If this damage was caused by bullet.
327 		 */
328         public
329         boolean isBulletHit() {
330             return
331          BulletHit;
332         }
333         
334 
335         
336         /**
337         
338 			If this damage was caused by vehicle running over us.
339 		 */
340         protected
341          boolean VehicleHit =
342         	false;
343 
344         
345         /**
346         
347 			If this damage was caused by vehicle running over us.
348 		 */
349         public
350         boolean isVehicleHit() {
351             return
352          VehicleHit;
353         }
354         
355 
356         
357             /////// Properties END
358 
359             /////// Extra Java code BEGIN
360 
361             	/////// Additional code from xslt BEGIN
362             		
363        					public long getSimTime() {
364        						// NOT IMPLEMENTED FOR UDK
365        						return 0;
366        					}
367             		
368 
369 
370             	/////// Additional code from xslt END
371 
372 	            /////// Extra Java from XML BEGIN
373             		
374             	/////// Extra Java from XML END
375 
376             /////// Extra Java code END
377 
378             
379 
380             /**
381               * Cloning constructor.
382               */
383              public PlayerKilled(PlayerKilled original) {
384                 
385                      this.Id=original.Id;
386                 
387                      this.Killer=original.Killer;
388                 
389                      this.KilledPawn=original.KilledPawn;
390                 
391                      this.DamageType=original.DamageType;
392                 
393                      this.DeathString=original.DeathString;
394                 
395                      this.WeaponName=original.WeaponName;
396                 
397                      this.Flaming=original.Flaming;
398                 
399                      this.CausedByWorld=original.CausedByWorld;
400                 
401                      this.DirectDamage=original.DirectDamage;
402                 
403                      this.BulletHit=original.BulletHit;
404                 
405                      this.VehicleHit=original.VehicleHit;
406                 
407              }
408 
409              
410                  /**
411                   * Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
412                   */
413 	             public PlayerKilled() {
414 	             }
415              
416 
417                  
418             public String toString() {
419                 return
420                 
421                 		super.toString() + " | " +
422                 		
423 				               "Id = " +
424 				               String.valueOf(Id) + " | " +
425 				            
426 				               "Killer = " +
427 				               String.valueOf(Killer) + " | " +
428 				            
429 				               "KilledPawn = " +
430 				               String.valueOf(KilledPawn) + " | " +
431 				            
432 				               "DamageType = " +
433 				               String.valueOf(DamageType) + " | " +
434 				            
435 				               "DeathString = " +
436 				               String.valueOf(DeathString) + " | " +
437 				            
438 				               "WeaponName = " +
439 				               String.valueOf(WeaponName) + " | " +
440 				            
441 				               "Flaming = " +
442 				               String.valueOf(Flaming) + " | " +
443 				            
444 				               "CausedByWorld = " +
445 				               String.valueOf(CausedByWorld) + " | " +
446 				            
447 				               "DirectDamage = " +
448 				               String.valueOf(DirectDamage) + " | " +
449 				            
450 				               "BulletHit = " +
451 				               String.valueOf(BulletHit) + " | " +
452 				            
453 				               "VehicleHit = " +
454 				               String.valueOf(VehicleHit) + " | " +
455 				             "";
456                 	
457              }
458 
459              public String toHtmlString() {
460                 return super.toString() +
461             
462             "<b>Id</b> : " +
463             String.valueOf(Id) +
464             " <br/> " +
465             
466             "<b>Killer</b> : " +
467             String.valueOf(Killer) +
468             " <br/> " +
469             
470             "<b>KilledPawn</b> : " +
471             String.valueOf(KilledPawn) +
472             " <br/> " +
473             
474             "<b>DamageType</b> : " +
475             String.valueOf(DamageType) +
476             " <br/> " +
477             
478             "<b>DeathString</b> : " +
479             String.valueOf(DeathString) +
480             " <br/> " +
481             
482             "<b>WeaponName</b> : " +
483             String.valueOf(WeaponName) +
484             " <br/> " +
485             
486             "<b>Flaming</b> : " +
487             String.valueOf(Flaming) +
488             " <br/> " +
489             
490             "<b>CausedByWorld</b> : " +
491             String.valueOf(CausedByWorld) +
492             " <br/> " +
493             
494             "<b>DirectDamage</b> : " +
495             String.valueOf(DirectDamage) +
496             " <br/> " +
497             
498             "<b>BulletHit</b> : " +
499             String.valueOf(BulletHit) +
500             " <br/> " +
501             
502             "<b>VehicleHit</b> : " +
503             String.valueOf(VehicleHit) +
504             " <br/> " +
505              "";
506              }
507 
508              
509              
510              }
511 
512