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