View Javadoc

1   package cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages;
2    		
3    		// --- IMPORTS FROM /messages/settings/javasettings/javaimport BEGIN
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   		// --- IMPORTS FROM /messages/settings/javasettings/javaimport END
6   		
7   		
8   		// --- IMPORTS FROM extra/code/java/javapart/classcategory[@name='all'] BEGIN
9   				
10  		// --- IMPORTS FROM extra/code/java/javapart/classcategory[@name='all'] END
11  		
12  		// --- IMPORTS FROM extra/code/java/javapart/classcategory[@name=local]+classtype[@name=impl] BEGIN
13  		
14  		// --- IMPORTS FROM extra/code/java/javapart/classcategory[@name=local]+classtype[@name=impl] END
15      
16   		/**
17           *  
18              				Implementation of the local part of the GameBots2004 message SLF.  
19              			
20           *
21           *  <p></p><p></p>
22           *  Complete message documentation:               
23           *  
24  		Synchronous message. Information about your bot's state.
25  	
26           */
27   	public class SelfLocalImpl 
28    						extends
29    						SelfLocal
30  	    {
31   	
32      	
33      	
34      	/**
35      	 * Parameter-less contructor for the message.
36      	 */
37  		public SelfLocalImpl()
38  		{
39  		}
40  	
41      	
42      	
43      	
44      	/**
45  		 * Creates new instance of the message Self.
46  		 * 
47  		Synchronous message. Information about your bot's state.
48  	
49  		 * Corresponding GameBots message
50  		 *   (local part)
51  		 *   is
52  		 *   SLF.
53  		 * 
54   	  	 * 
55  		 *   
56  		 *     @param Id Unique Id of this self message instance.
57  		 *   
58  		 * 
59  		 *   
60  		 *     @param BotId Unique Id of this bot.
61  		 *   
62  		 * 
63  		 *   
64  		 *     @param Name Human readable bot name.
65  		 *   
66  		 * 
67  		 *   
68  		 *     @param Vehicle If we are vehicle just these attr. are sent in SLF: "Id","Vehicle""Rotation", "Location","Velocity ","Name ","Team" ,"Health" 
69  	"Armor","Adrenaline", "FloorLocation", "FloorNormal".
70  		 *   
71  		 * 
72  		 *   
73  		 *     @param Location 
74  			An absolute location of the bot.
75  		
76  		 *   
77  		 * 
78  		 *   
79  		 *     @param Velocity 
80  			Absolute velocity of the bot as a vector of movement per one
81  			game second.
82  		
83  		 *   
84  		 * 
85  		 *   
86  		 *     @param Rotation 
87  			Which direction the bot is facing in absolute terms.
88  		
89  		 *   
90  		 * 
91  		 *   
92  		 *     @param Team 
93  			What team the bot is on. 255 is no team. 0-3 are red,
94  			blue, green, gold in that order.
95  		
96  		 *   
97  		 * 
98  		 *   
99  		 *     @param Weapon 
100 			Id of the weapon we are holding. This is unique Id of an
101 			item in our inventory and is different from the Id of the
102 			item we pick up from the ground! We can parse this string to
103 			look which weapon we hold. Weapon strings to look for
104 			include: "AssaultRifle", "ShieldGun", "FlakCannon",
105 			"BioRifle", "ShockRifle", "LinkGun", "SniperRifle",
106 			"RocketLauncher", "Minigun", "LightingGun", "Translocator".
107 			TODO: Look if this is all.
108 		
109 		 *   
110 		 * 
111 		 *   
112 		 *     @param Shooting If the bot is shooting or not.
113 		 *   
114 		 * 
115 		 *   
116 		 *     @param Health 
117 			How much health the bot has left. Starts at 100, ranges from
118 			0 to 200.
119 		
120 		 *   
121 		 * 
122 		 *   
123 		 *     @param PrimaryAmmo 
124 			How much ammo the bot has left for current weapon primary
125 			mode.
126 		
127 		 *   
128 		 * 
129 		 *   
130 		 *     @param SecondaryAmmo 
131 			How much ammo the bot has left for current weapon secondary
132 			mode. Weapon does not have to support sec. fire mode.
133 		
134 		 *   
135 		 * 
136 		 *   
137 		 *     @param Adrenaline How much adrenaline the bot has.
138 		 *   
139 		 * 
140 		 *   
141 		 *     @param Armor 
142 			Combined size of high armor and low armor (or small armor). The high and low armor are tracked
143                         separately. Low armor is limited to 50 points, while the
144                         high armor can have up to 150 points. Both stacks can have a combined size of 150 points as well,
145                         so if low armor is already at 50 points, high armor can have
146                         100 points at max.
147 		
148 		 *   
149 		 * 
150 		 *   
151 		 *     @param SmallArmor 
152 			Also refered to as a "low armor". Ranges from 0 to 50 points.
153 		
154 		 *   
155 		 * 
156 		 *   
157 		 *     @param AltFiring 
158 			If we are firing in secondary firing mode. 
159 		
160 		 *   
161 		 * 
162 		 *   
163 		 *     @param Crouched 
164 			If we are currently crouched.
165 		
166 		 *   
167 		 * 
168 		 *   
169 		 *     @param Walking 
170 			If we are currently in walking mode.
171 		
172 		 *   
173 		 * 
174 		 *   
175 		 *     @param FloorLocation 
176 			Holds current floor location under the bot.
177 		
178 		 *   
179 		 * 
180 		 *   
181 		 *     @param FloorNormal 
182 			Holds current floor normal under the bot.
183 		
184 		 *   
185 		 * 
186 		 *   
187 		 *     @param Combo 
188 			Name of the current combo (None if no combo active).
189 			Can be xGame.ComboBerserk, xGame.ComboDefensive, xGame.ComboInvis or xGame.ComboSpeed.
190 			To trigger combo adrenaline needs to be at 100 (maximum) and no other combo can be active.
191 		
192 		 *   
193 		 * 
194 		 *   
195 		 *     @param UDamageTime 
196 			Time when the UDamage effect expires. If the number is higher then the current
197 			time, it means the bot has UDamage effect active right now.
198 		
199 		 *   
200 		 * 
201 		 *   
202 		 *     @param Action 
203 			Name of the current BDI action.
204 		
205 		 *   
206 		 * 
207 		 *   
208 		 *     @param EmotLeft 
209 			For UE2. Holds left emoticon of the bot, "None" means none set.
210 		
211 		 *   
212 		 * 
213 		 *   
214 		 *     @param EmotCenter 
215 			For UE2. Holds center emoticon of the bot, "None" means none set.
216 		
217 		 *   
218 		 * 
219 		 *   
220 		 *     @param EmotRight 
221 			For UE2. Holds right emoticon of the bot, "None" means none set.
222 		
223 		 *   
224 		 * 
225 		 *   
226 		 *     @param Bubble 
227 			For UE2. Holds the bubble of the emoticon of the bot, "None" means none set.
228 		
229 		 *   
230 		 * 
231 		 *   
232 		 *     @param Anim 
233 			For UE2. Current played animation of the bot.
234 		
235 		 *   
236 		 * 
237 		 */
238 		public SelfLocalImpl(
239 			UnrealId Id,  UnrealId BotId,  String Name,  boolean Vehicle,  Location Location,  Velocity Velocity,  Rotation Rotation,  int Team,  String Weapon,  boolean Shooting,  int Health,  int PrimaryAmmo,  int SecondaryAmmo,  int Adrenaline,  int Armor,  int SmallArmor,  boolean AltFiring,  boolean Crouched,  boolean Walking,  Location FloorLocation,  Location FloorNormal,  String Combo,  double UDamageTime,  String Action,  String EmotLeft,  String EmotCenter,  String EmotRight,  String Bubble,  String Anim
240 		) {
241 			
242 					this.Id = Id;
243 				
244 					this.BotId = BotId;
245 				
246 					this.Name = Name;
247 				
248 					this.Vehicle = Vehicle;
249 				
250 					this.Location = Location;
251 				
252 					this.Velocity = Velocity;
253 				
254 					this.Rotation = Rotation;
255 				
256 					this.Team = Team;
257 				
258 					this.Weapon = Weapon;
259 				
260 					this.Shooting = Shooting;
261 				
262 					this.Health = Health;
263 				
264 					this.PrimaryAmmo = PrimaryAmmo;
265 				
266 					this.SecondaryAmmo = SecondaryAmmo;
267 				
268 					this.Adrenaline = Adrenaline;
269 				
270 					this.Armor = Armor;
271 				
272 					this.SmallArmor = SmallArmor;
273 				
274 					this.AltFiring = AltFiring;
275 				
276 					this.Crouched = Crouched;
277 				
278 					this.Walking = Walking;
279 				
280 					this.FloorLocation = FloorLocation;
281 				
282 					this.FloorNormal = FloorNormal;
283 				
284 					this.Combo = Combo;
285 				
286 					this.UDamageTime = UDamageTime;
287 				
288 					this.Action = Action;
289 				
290 					this.EmotLeft = EmotLeft;
291 				
292 					this.EmotCenter = EmotCenter;
293 				
294 					this.EmotRight = EmotRight;
295 				
296 					this.Bubble = Bubble;
297 				
298 					this.Anim = Anim;
299 				
300 		}
301     
302     	/**
303 		 * Cloning constructor from the full message.
304 		 *
305 		 * @param original
306 		 */
307 		public SelfLocalImpl(Self original) {		
308 			
309 					this.Id = original.getId()
310  	;
311 				
312 					this.BotId = original.getBotId()
313  	;
314 				
315 					this.Name = original.getName()
316  	;
317 				
318 					this.Vehicle = original.isVehicle()
319  	;
320 				
321 					this.Location = original.getLocation()
322  	;
323 				
324 					this.Velocity = original.getVelocity()
325  	;
326 				
327 					this.Rotation = original.getRotation()
328  	;
329 				
330 					this.Team = original.getTeam()
331  	;
332 				
333 					this.Weapon = original.getWeapon()
334  	;
335 				
336 					this.Shooting = original.isShooting()
337  	;
338 				
339 					this.Health = original.getHealth()
340  	;
341 				
342 					this.PrimaryAmmo = original.getPrimaryAmmo()
343  	;
344 				
345 					this.SecondaryAmmo = original.getSecondaryAmmo()
346  	;
347 				
348 					this.Adrenaline = original.getAdrenaline()
349  	;
350 				
351 					this.Armor = original.getArmor()
352  	;
353 				
354 					this.SmallArmor = original.getSmallArmor()
355  	;
356 				
357 					this.AltFiring = original.isAltFiring()
358  	;
359 				
360 					this.Crouched = original.isCrouched()
361  	;
362 				
363 					this.Walking = original.isWalking()
364  	;
365 				
366 					this.FloorLocation = original.getFloorLocation()
367  	;
368 				
369 					this.FloorNormal = original.getFloorNormal()
370  	;
371 				
372 					this.Combo = original.getCombo()
373  	;
374 				
375 					this.UDamageTime = original.getUDamageTime()
376  	;
377 				
378 					this.Action = original.getAction()
379  	;
380 				
381 					this.EmotLeft = original.getEmotLeft()
382  	;
383 				
384 					this.EmotCenter = original.getEmotCenter()
385  	;
386 				
387 					this.EmotRight = original.getEmotRight()
388  	;
389 				
390 					this.Bubble = original.getBubble()
391  	;
392 				
393 					this.Anim = original.getAnim()
394  	;
395 				
396 			this.SimTime = original.getSimTime();			
397 		}
398 		
399 		/**
400 		 * Cloning constructor from the full message.
401 		 *
402 		 * @param original
403 		 */
404 		public SelfLocalImpl(SelfLocalImpl original) {		
405 			
406 					this.Id = original.getId()
407  	;
408 				
409 					this.BotId = original.getBotId()
410  	;
411 				
412 					this.Name = original.getName()
413  	;
414 				
415 					this.Vehicle = original.isVehicle()
416  	;
417 				
418 					this.Location = original.getLocation()
419  	;
420 				
421 					this.Velocity = original.getVelocity()
422  	;
423 				
424 					this.Rotation = original.getRotation()
425  	;
426 				
427 					this.Team = original.getTeam()
428  	;
429 				
430 					this.Weapon = original.getWeapon()
431  	;
432 				
433 					this.Shooting = original.isShooting()
434  	;
435 				
436 					this.Health = original.getHealth()
437  	;
438 				
439 					this.PrimaryAmmo = original.getPrimaryAmmo()
440  	;
441 				
442 					this.SecondaryAmmo = original.getSecondaryAmmo()
443  	;
444 				
445 					this.Adrenaline = original.getAdrenaline()
446  	;
447 				
448 					this.Armor = original.getArmor()
449  	;
450 				
451 					this.SmallArmor = original.getSmallArmor()
452  	;
453 				
454 					this.AltFiring = original.isAltFiring()
455  	;
456 				
457 					this.Crouched = original.isCrouched()
458  	;
459 				
460 					this.Walking = original.isWalking()
461  	;
462 				
463 					this.FloorLocation = original.getFloorLocation()
464  	;
465 				
466 					this.FloorNormal = original.getFloorNormal()
467  	;
468 				
469 					this.Combo = original.getCombo()
470  	;
471 				
472 					this.UDamageTime = original.getUDamageTime()
473  	;
474 				
475 					this.Action = original.getAction()
476  	;
477 				
478 					this.EmotLeft = original.getEmotLeft()
479  	;
480 				
481 					this.EmotCenter = original.getEmotCenter()
482  	;
483 				
484 					this.EmotRight = original.getEmotRight()
485  	;
486 				
487 					this.Bubble = original.getBubble()
488  	;
489 				
490 					this.Anim = original.getAnim()
491  	;
492 				
493 			this.SimTime = original.getSimTime();
494 		}
495 		
496 			/**
497 			 * Cloning constructor from the message part.
498 			 *
499 			 * @param original
500 			 */
501 			public SelfLocalImpl(SelfLocal original) {
502 				
503 						this.Id = original.getId()
504  	;
505 					
506 						this.BotId = original.getBotId()
507  	;
508 					
509 						this.Name = original.getName()
510  	;
511 					
512 						this.Vehicle = original.isVehicle()
513  	;
514 					
515 						this.Location = original.getLocation()
516  	;
517 					
518 						this.Velocity = original.getVelocity()
519  	;
520 					
521 						this.Rotation = original.getRotation()
522  	;
523 					
524 						this.Team = original.getTeam()
525  	;
526 					
527 						this.Weapon = original.getWeapon()
528  	;
529 					
530 						this.Shooting = original.isShooting()
531  	;
532 					
533 						this.Health = original.getHealth()
534  	;
535 					
536 						this.PrimaryAmmo = original.getPrimaryAmmo()
537  	;
538 					
539 						this.SecondaryAmmo = original.getSecondaryAmmo()
540  	;
541 					
542 						this.Adrenaline = original.getAdrenaline()
543  	;
544 					
545 						this.Armor = original.getArmor()
546  	;
547 					
548 						this.SmallArmor = original.getSmallArmor()
549  	;
550 					
551 						this.AltFiring = original.isAltFiring()
552  	;
553 					
554 						this.Crouched = original.isCrouched()
555  	;
556 					
557 						this.Walking = original.isWalking()
558  	;
559 					
560 						this.FloorLocation = original.getFloorLocation()
561  	;
562 					
563 						this.FloorNormal = original.getFloorNormal()
564  	;
565 					
566 						this.Combo = original.getCombo()
567  	;
568 					
569 						this.UDamageTime = original.getUDamageTime()
570  	;
571 					
572 						this.Action = original.getAction()
573  	;
574 					
575 						this.EmotLeft = original.getEmotLeft()
576  	;
577 					
578 						this.EmotCenter = original.getEmotCenter()
579  	;
580 					
581 						this.EmotRight = original.getEmotRight()
582  	;
583 					
584 						this.Bubble = original.getBubble()
585  	;
586 					
587 						this.Anim = original.getAnim()
588  	;
589 					
590 			}
591 		
592    				
593    				@Override
594    				public void setSimTime(long SimTime) {
595 					super.setSimTime(SimTime);
596 				}
597    			
598 	    				@Override
599 	    				public 
600 	    				SelfLocalImpl clone() {
601 	    					return new 
602 	    					SelfLocalImpl(this);
603 	    				}
604 	    				
605 	    				
606     	
607 	    /**
608          * Unique Id of this self message instance. 
609          */
610         protected
611          UnrealId Id =
612        	null;
613 	
614  		/**
615          * Unique Id of this self message instance. 
616          */
617         public  UnrealId getId()
618  	 {
619 				    					return Id;
620 				    				}
621 				    			
622     	
623 	    /**
624          * Unique Id of this bot. 
625          */
626         protected
627          UnrealId BotId =
628        	null;
629 	
630  		/**
631          * Unique Id of this bot. 
632          */
633         public  UnrealId getBotId()
634  	 {
635 				    					return BotId;
636 				    				}
637 				    			
638     	
639 	    /**
640          * Human readable bot name. 
641          */
642         protected
643          String Name =
644        	null;
645 	
646  		/**
647          * Human readable bot name. 
648          */
649         public  String getName()
650  	 {
651 				    					return Name;
652 				    				}
653 				    			
654     	
655 	    /**
656          * If we are vehicle just these attr. are sent in SLF: "Id","Vehicle""Rotation", "Location","Velocity ","Name ","Team" ,"Health" 
657 	"Armor","Adrenaline", "FloorLocation", "FloorNormal". 
658          */
659         protected
660          boolean Vehicle =
661        	false;
662 	
663  		/**
664          * If we are vehicle just these attr. are sent in SLF: "Id","Vehicle""Rotation", "Location","Velocity ","Name ","Team" ,"Health" 
665 	"Armor","Adrenaline", "FloorLocation", "FloorNormal". 
666          */
667         public  boolean isVehicle()
668  	 {
669 				    					return Vehicle;
670 				    				}
671 				    			
672     	
673 	    /**
674          * 
675 			An absolute location of the bot.
676 		 
677          */
678         protected
679          Location Location =
680        	null;
681 	
682  		/**
683          * 
684 			An absolute location of the bot.
685 		 
686          */
687         public  Location getLocation()
688  	 {
689 				    					return Location;
690 				    				}
691 				    			
692     	
693 	    /**
694          * 
695 			Absolute velocity of the bot as a vector of movement per one
696 			game second.
697 		 
698          */
699         protected
700          Velocity Velocity =
701        	null;
702 	
703  		/**
704          * 
705 			Absolute velocity of the bot as a vector of movement per one
706 			game second.
707 		 
708          */
709         public  Velocity getVelocity()
710  	 {
711 				    					return Velocity;
712 				    				}
713 				    			
714     	
715 	    /**
716          * 
717 			Which direction the bot is facing in absolute terms.
718 		 
719          */
720         protected
721          Rotation Rotation =
722        	null;
723 	
724  		/**
725          * 
726 			Which direction the bot is facing in absolute terms.
727 		 
728          */
729         public  Rotation getRotation()
730  	 {
731 				    					return Rotation;
732 				    				}
733 				    			
734     	
735 	    /**
736          * 
737 			What team the bot is on. 255 is no team. 0-3 are red,
738 			blue, green, gold in that order.
739 		 
740          */
741         protected
742          int Team =
743        	0;
744 	
745  		/**
746          * 
747 			What team the bot is on. 255 is no team. 0-3 are red,
748 			blue, green, gold in that order.
749 		 
750          */
751         public  int getTeam()
752  	 {
753 				    					return Team;
754 				    				}
755 				    			
756     	
757 	    /**
758          * 
759 			Id of the weapon we are holding. This is unique Id of an
760 			item in our inventory and is different from the Id of the
761 			item we pick up from the ground! We can parse this string to
762 			look which weapon we hold. Weapon strings to look for
763 			include: "AssaultRifle", "ShieldGun", "FlakCannon",
764 			"BioRifle", "ShockRifle", "LinkGun", "SniperRifle",
765 			"RocketLauncher", "Minigun", "LightingGun", "Translocator".
766 			TODO: Look if this is all.
767 		 
768          */
769         protected
770          String Weapon =
771        	null;
772 	
773  		/**
774          * 
775 			Id of the weapon we are holding. This is unique Id of an
776 			item in our inventory and is different from the Id of the
777 			item we pick up from the ground! We can parse this string to
778 			look which weapon we hold. Weapon strings to look for
779 			include: "AssaultRifle", "ShieldGun", "FlakCannon",
780 			"BioRifle", "ShockRifle", "LinkGun", "SniperRifle",
781 			"RocketLauncher", "Minigun", "LightingGun", "Translocator".
782 			TODO: Look if this is all.
783 		 
784          */
785         public  String getWeapon()
786  	 {
787 				    					return Weapon;
788 				    				}
789 				    			
790     	
791 	    /**
792          * If the bot is shooting or not. 
793          */
794         protected
795          boolean Shooting =
796        	false;
797 	
798  		/**
799          * If the bot is shooting or not. 
800          */
801         public  boolean isShooting()
802  	 {
803 				    					return Shooting;
804 				    				}
805 				    			
806     	
807 	    /**
808          * 
809 			How much health the bot has left. Starts at 100, ranges from
810 			0 to 200.
811 		 
812          */
813         protected
814          int Health =
815        	0;
816 	
817  		/**
818          * 
819 			How much health the bot has left. Starts at 100, ranges from
820 			0 to 200.
821 		 
822          */
823         public  int getHealth()
824  	 {
825 				    					return Health;
826 				    				}
827 				    			
828     	
829 	    /**
830          * 
831 			How much ammo the bot has left for current weapon primary
832 			mode.
833 		 
834          */
835         protected
836          int PrimaryAmmo =
837        	0;
838 	
839  		/**
840          * 
841 			How much ammo the bot has left for current weapon primary
842 			mode.
843 		 
844          */
845         public  int getPrimaryAmmo()
846  	 {
847 				    					return PrimaryAmmo;
848 				    				}
849 				    			
850     	
851 	    /**
852          * 
853 			How much ammo the bot has left for current weapon secondary
854 			mode. Weapon does not have to support sec. fire mode.
855 		 
856          */
857         protected
858          int SecondaryAmmo =
859        	0;
860 	
861  		/**
862          * 
863 			How much ammo the bot has left for current weapon secondary
864 			mode. Weapon does not have to support sec. fire mode.
865 		 
866          */
867         public  int getSecondaryAmmo()
868  	 {
869 				    					return SecondaryAmmo;
870 				    				}
871 				    			
872     	
873 	    /**
874          * How much adrenaline the bot has. 
875          */
876         protected
877          int Adrenaline =
878        	0;
879 	
880  		/**
881          * How much adrenaline the bot has. 
882          */
883         public  int getAdrenaline()
884  	 {
885 				    					return Adrenaline;
886 				    				}
887 				    			
888     	
889 	    /**
890          * 
891 			Combined size of high armor and low armor (or small armor). The high and low armor are tracked
892                         separately. Low armor is limited to 50 points, while the
893                         high armor can have up to 150 points. Both stacks can have a combined size of 150 points as well,
894                         so if low armor is already at 50 points, high armor can have
895                         100 points at max.
896 		 
897          */
898         protected
899          int Armor =
900        	0;
901 	
902  		/**
903          * 
904 			Combined size of high armor and low armor (or small armor). The high and low armor are tracked
905                         separately. Low armor is limited to 50 points, while the
906                         high armor can have up to 150 points. Both stacks can have a combined size of 150 points as well,
907                         so if low armor is already at 50 points, high armor can have
908                         100 points at max.
909 		 
910          */
911         public  int getArmor()
912  	 {
913 				    					return Armor;
914 				    				}
915 				    			
916     	
917 	    /**
918          * 
919 			Also refered to as a "low armor". Ranges from 0 to 50 points.
920 		 
921          */
922         protected
923          int SmallArmor =
924        	0;
925 	
926  		/**
927          * 
928 			Also refered to as a "low armor". Ranges from 0 to 50 points.
929 		 
930          */
931         public  int getSmallArmor()
932  	 {
933 				    					return SmallArmor;
934 				    				}
935 				    			
936     	
937 	    /**
938          * 
939 			If we are firing in secondary firing mode. 
940 		 
941          */
942         protected
943          boolean AltFiring =
944        	false;
945 	
946  		/**
947          * 
948 			If we are firing in secondary firing mode. 
949 		 
950          */
951         public  boolean isAltFiring()
952  	 {
953 				    					return AltFiring;
954 				    				}
955 				    			
956     	
957 	    /**
958          * 
959 			If we are currently crouched.
960 		 
961          */
962         protected
963          boolean Crouched =
964        	false;
965 	
966  		/**
967          * 
968 			If we are currently crouched.
969 		 
970          */
971         public  boolean isCrouched()
972  	 {
973 				    					return Crouched;
974 				    				}
975 				    			
976     	
977 	    /**
978          * 
979 			If we are currently in walking mode.
980 		 
981          */
982         protected
983          boolean Walking =
984        	false;
985 	
986  		/**
987          * 
988 			If we are currently in walking mode.
989 		 
990          */
991         public  boolean isWalking()
992  	 {
993 				    					return Walking;
994 				    				}
995 				    			
996     	
997 	    /**
998          * 
999 			Holds current floor location under the bot.
1000 		 
1001          */
1002         protected
1003          Location FloorLocation =
1004        	null;
1005 	
1006  		/**
1007          * 
1008 			Holds current floor location under the bot.
1009 		 
1010          */
1011         public  Location getFloorLocation()
1012  	 {
1013 				    					return FloorLocation;
1014 				    				}
1015 				    			
1016     	
1017 	    /**
1018          * 
1019 			Holds current floor normal under the bot.
1020 		 
1021          */
1022         protected
1023          Location FloorNormal =
1024        	null;
1025 	
1026  		/**
1027          * 
1028 			Holds current floor normal under the bot.
1029 		 
1030          */
1031         public  Location getFloorNormal()
1032  	 {
1033 				    					return FloorNormal;
1034 				    				}
1035 				    			
1036     	
1037 	    /**
1038          * 
1039 			Name of the current combo (None if no combo active).
1040 			Can be xGame.ComboBerserk, xGame.ComboDefensive, xGame.ComboInvis or xGame.ComboSpeed.
1041 			To trigger combo adrenaline needs to be at 100 (maximum) and no other combo can be active.
1042 		 
1043          */
1044         protected
1045          String Combo =
1046        	null;
1047 	
1048  		/**
1049          * 
1050 			Name of the current combo (None if no combo active).
1051 			Can be xGame.ComboBerserk, xGame.ComboDefensive, xGame.ComboInvis or xGame.ComboSpeed.
1052 			To trigger combo adrenaline needs to be at 100 (maximum) and no other combo can be active.
1053 		 
1054          */
1055         public  String getCombo()
1056  	 {
1057 				    					return Combo;
1058 				    				}
1059 				    			
1060     	
1061 	    /**
1062          * 
1063 			Time when the UDamage effect expires. If the number is higher then the current
1064 			time, it means the bot has UDamage effect active right now.
1065 		 
1066          */
1067         protected
1068          double UDamageTime =
1069        	0;
1070 	
1071  		/**
1072          * 
1073 			Time when the UDamage effect expires. If the number is higher then the current
1074 			time, it means the bot has UDamage effect active right now.
1075 		 
1076          */
1077         public  double getUDamageTime()
1078  	 {
1079 				    					return UDamageTime;
1080 				    				}
1081 				    			
1082     	
1083 	    /**
1084          * 
1085 			Name of the current BDI action.
1086 		 
1087          */
1088         protected
1089          String Action =
1090        	null;
1091 	
1092  		/**
1093          * 
1094 			Name of the current BDI action.
1095 		 
1096          */
1097         public  String getAction()
1098  	 {
1099 				    					return Action;
1100 				    				}
1101 				    			
1102     	
1103 	    /**
1104          * 
1105 			For UE2. Holds left emoticon of the bot, "None" means none set.
1106 		 
1107          */
1108         protected
1109          String EmotLeft =
1110        	null;
1111 	
1112  		/**
1113          * 
1114 			For UE2. Holds left emoticon of the bot, "None" means none set.
1115 		 
1116          */
1117         public  String getEmotLeft()
1118  	 {
1119 				    					return EmotLeft;
1120 				    				}
1121 				    			
1122     	
1123 	    /**
1124          * 
1125 			For UE2. Holds center emoticon of the bot, "None" means none set.
1126 		 
1127          */
1128         protected
1129          String EmotCenter =
1130        	null;
1131 	
1132  		/**
1133          * 
1134 			For UE2. Holds center emoticon of the bot, "None" means none set.
1135 		 
1136          */
1137         public  String getEmotCenter()
1138  	 {
1139 				    					return EmotCenter;
1140 				    				}
1141 				    			
1142     	
1143 	    /**
1144          * 
1145 			For UE2. Holds right emoticon of the bot, "None" means none set.
1146 		 
1147          */
1148         protected
1149          String EmotRight =
1150        	null;
1151 	
1152  		/**
1153          * 
1154 			For UE2. Holds right emoticon of the bot, "None" means none set.
1155 		 
1156          */
1157         public  String getEmotRight()
1158  	 {
1159 				    					return EmotRight;
1160 				    				}
1161 				    			
1162     	
1163 	    /**
1164          * 
1165 			For UE2. Holds the bubble of the emoticon of the bot, "None" means none set.
1166 		 
1167          */
1168         protected
1169          String Bubble =
1170        	null;
1171 	
1172  		/**
1173          * 
1174 			For UE2. Holds the bubble of the emoticon of the bot, "None" means none set.
1175 		 
1176          */
1177         public  String getBubble()
1178  	 {
1179 				    					return Bubble;
1180 				    				}
1181 				    			
1182     	
1183 	    /**
1184          * 
1185 			For UE2. Current played animation of the bot.
1186 		 
1187          */
1188         protected
1189          String Anim =
1190        	null;
1191 	
1192  		/**
1193          * 
1194 			For UE2. Current played animation of the bot.
1195 		 
1196          */
1197         public  String getAnim()
1198  	 {
1199 				    					return Anim;
1200 				    				}
1201 				    			
1202     	
1203     	
1204     	
1205     	
1206     	public SelfLocalImpl getLocal() {
1207 			return this;
1208     	}
1209 		public ISharedWorldObject getShared() {
1210 		 	throw new UnsupportedOperationException("Could not return LOCAL as SHARED");
1211 		}
1212 		public IStaticWorldObject getStatic() {
1213 		    throw new UnsupportedOperationException("Could not return LOCAL as STATIC");
1214 		}
1215  	
1216 		public static class SelfLocalUpdate
1217      implements ILocalWorldObjectUpdatedEvent, IGBWorldObjectEvent
1218 		{
1219 			protected long time;
1220 			
1221 			protected SelfLocal data = null; //contains object data for this update
1222 			
1223 			public SelfLocalUpdate
1224     (SelfLocal moverLocal, long time)
1225 			{
1226 				this.data = moverLocal;
1227 				this.time = time;
1228 			}
1229 			
1230 			@Override
1231 			public IWorldObjectUpdateResult<ILocalWorldObject> update(
1232 					ILocalWorldObject object) 
1233 			{
1234 				if ( object == null)
1235 				{
1236 					data = new SelfLocalImpl(data); //we always return Impl object
1237 					return new IWorldObjectUpdateResult.WorldObjectUpdateResult<ILocalWorldObject>(IWorldObjectUpdateResult.Result.CREATED, data);
1238 				}
1239 				if ( object instanceof SelfLocalImpl )
1240 				{
1241 					SelfLocalImpl toUpdate = (SelfLocalImpl)object;
1242 					
1243 					boolean updated = false;
1244 					
1245 					// UPDATING LOCAL PROPERTIES
1246 					
1247 				if (!SafeEquals.equals(toUpdate.BotId, data.getBotId()
1248  	)) {
1249 					toUpdate.BotId=data.getBotId()
1250  	;
1251 					updated = true;
1252 				}
1253 			
1254 				if (!SafeEquals.equals(toUpdate.Name, data.getName()
1255  	)) {
1256 					toUpdate.Name=data.getName()
1257  	;
1258 					updated = true;
1259 				}
1260 			
1261 				if (toUpdate.Vehicle != data.isVehicle()
1262  	) {
1263 				    toUpdate.Vehicle=data.isVehicle()
1264  	;
1265 					updated = true;
1266 				}
1267 			
1268 	            if (!SafeEquals.equals(toUpdate.Location, data.getLocation()
1269  	)) {
1270 					toUpdate.Location=data.getLocation()
1271  	;
1272 					updated = true;
1273 				}
1274 			
1275 				if (!SafeEquals.equals(toUpdate.Velocity, data.getVelocity()
1276  	)) {
1277 					toUpdate.Velocity=data.getVelocity()
1278  	;
1279 					updated = true;
1280 				}
1281 			
1282 				if (!SafeEquals.equals(toUpdate.Rotation, data.getRotation()
1283  	)) {
1284 					toUpdate.Rotation=data.getRotation()
1285  	;
1286 					updated = true;
1287 				}
1288 			
1289 				if (toUpdate.Team != data.getTeam()
1290  	) {
1291 				    toUpdate.Team=data.getTeam()
1292  	;
1293 					updated = true;
1294 				}
1295 			
1296 				if (!SafeEquals.equals(toUpdate.Weapon, data.getWeapon()
1297  	)) {
1298 					toUpdate.Weapon=data.getWeapon()
1299  	;
1300 					updated = true;
1301 				}
1302 			
1303 				if (toUpdate.Shooting != data.isShooting()
1304  	) {
1305 				    toUpdate.Shooting=data.isShooting()
1306  	;
1307 					updated = true;
1308 				}
1309 			
1310 				if (toUpdate.Health != data.getHealth()
1311  	) {
1312 				    toUpdate.Health=data.getHealth()
1313  	;
1314 					updated = true;
1315 				}
1316 			
1317 				if (toUpdate.PrimaryAmmo != data.getPrimaryAmmo()
1318  	) {
1319 				    toUpdate.PrimaryAmmo=data.getPrimaryAmmo()
1320  	;
1321 					updated = true;
1322 				}
1323 			
1324 				if (toUpdate.SecondaryAmmo != data.getSecondaryAmmo()
1325  	) {
1326 				    toUpdate.SecondaryAmmo=data.getSecondaryAmmo()
1327  	;
1328 					updated = true;
1329 				}
1330 			
1331 				if (toUpdate.Adrenaline != data.getAdrenaline()
1332  	) {
1333 				    toUpdate.Adrenaline=data.getAdrenaline()
1334  	;
1335 					updated = true;
1336 				}
1337 			
1338 				if (toUpdate.Armor != data.getArmor()
1339  	) {
1340 				    toUpdate.Armor=data.getArmor()
1341  	;
1342 					updated = true;
1343 				}
1344 			
1345 				if (toUpdate.SmallArmor != data.getSmallArmor()
1346  	) {
1347 				    toUpdate.SmallArmor=data.getSmallArmor()
1348  	;
1349 					updated = true;
1350 				}
1351 			
1352 				if (toUpdate.AltFiring != data.isAltFiring()
1353  	) {
1354 				    toUpdate.AltFiring=data.isAltFiring()
1355  	;
1356 					updated = true;
1357 				}
1358 			
1359 				if (toUpdate.Crouched != data.isCrouched()
1360  	) {
1361 				    toUpdate.Crouched=data.isCrouched()
1362  	;
1363 					updated = true;
1364 				}
1365 			
1366 				if (toUpdate.Walking != data.isWalking()
1367  	) {
1368 				    toUpdate.Walking=data.isWalking()
1369  	;
1370 					updated = true;
1371 				}
1372 			
1373 	            if (!SafeEquals.equals(toUpdate.FloorLocation, data.getFloorLocation()
1374  	)) {
1375 					toUpdate.FloorLocation=data.getFloorLocation()
1376  	;
1377 					updated = true;
1378 				}
1379 			
1380 	            if (!SafeEquals.equals(toUpdate.FloorNormal, data.getFloorNormal()
1381  	)) {
1382 					toUpdate.FloorNormal=data.getFloorNormal()
1383  	;
1384 					updated = true;
1385 				}
1386 			
1387 				if (!SafeEquals.equals(toUpdate.Combo, data.getCombo()
1388  	)) {
1389 					toUpdate.Combo=data.getCombo()
1390  	;
1391 					updated = true;
1392 				}
1393 			
1394 				if (toUpdate.UDamageTime != data.getUDamageTime()
1395  	) {
1396 				    toUpdate.UDamageTime=data.getUDamageTime()
1397  	;
1398 					updated = true;
1399 				}
1400 			
1401 				if (!SafeEquals.equals(toUpdate.Action, data.getAction()
1402  	)) {
1403 					toUpdate.Action=data.getAction()
1404  	;
1405 					updated = true;
1406 				}
1407 			
1408 				if (!SafeEquals.equals(toUpdate.EmotLeft, data.getEmotLeft()
1409  	)) {
1410 					toUpdate.EmotLeft=data.getEmotLeft()
1411  	;
1412 					updated = true;
1413 				}
1414 			
1415 				if (!SafeEquals.equals(toUpdate.EmotCenter, data.getEmotCenter()
1416  	)) {
1417 					toUpdate.EmotCenter=data.getEmotCenter()
1418  	;
1419 					updated = true;
1420 				}
1421 			
1422 				if (!SafeEquals.equals(toUpdate.EmotRight, data.getEmotRight()
1423  	)) {
1424 					toUpdate.EmotRight=data.getEmotRight()
1425  	;
1426 					updated = true;
1427 				}
1428 			
1429 				if (!SafeEquals.equals(toUpdate.Bubble, data.getBubble()
1430  	)) {
1431 					toUpdate.Bubble=data.getBubble()
1432  	;
1433 					updated = true;
1434 				}
1435 			
1436 				if (!SafeEquals.equals(toUpdate.Anim, data.getAnim()
1437  	)) {
1438 					toUpdate.Anim=data.getAnim()
1439  	;
1440 					updated = true;
1441 				}
1442 			
1443 					
1444 					data = toUpdate; //the updating has finished
1445 					
1446 					if ( updated )
1447 					{
1448 						toUpdate.SimTime = this.time;
1449 						return new IWorldObjectUpdateResult.WorldObjectUpdateResult<ILocalWorldObject>(IWorldObjectUpdateResult.Result.UPDATED, data);
1450 					}
1451 					
1452 					return new IWorldObjectUpdateResult.WorldObjectUpdateResult<ILocalWorldObject>(IWorldObjectUpdateResult.Result.SAME, data);
1453 				}
1454 				throw new PogamutException("Unsupported object type for update. Expected SelfLocalImpl for object " + object.getId() +", not object of class " + object.getClass().getSimpleName() + ".", this);
1455 			}
1456 	
1457 			/**
1458 			 * Simulation time in MILLI SECONDS !!!
1459 			 */
1460 			@Override
1461 			public long getSimTime() {
1462 				return this.time;
1463 			}
1464 	
1465 			@Override
1466 			public IWorldObject getObject() {
1467 				return data;
1468 			}
1469 	
1470 			@Override
1471 			public WorldObjectId getId() {
1472 				return data.getId();
1473 			}
1474 			
1475 		}	
1476  	
1477  		
1478  	    public String toString() {
1479             return
1480             	super.toString() + "[" +
1481             	
1482 		              			"Id = " + String.valueOf(getId()
1483  	) + " | " + 
1484 		              		
1485 		              			"BotId = " + String.valueOf(getBotId()
1486  	) + " | " + 
1487 		              		
1488 		              			"Name = " + String.valueOf(getName()
1489  	) + " | " + 
1490 		              		
1491 		              			"Vehicle = " + String.valueOf(isVehicle()
1492  	) + " | " + 
1493 		              		
1494 		              			"Location = " + String.valueOf(getLocation()
1495  	) + " | " + 
1496 		              		
1497 		              			"Velocity = " + String.valueOf(getVelocity()
1498  	) + " | " + 
1499 		              		
1500 		              			"Rotation = " + String.valueOf(getRotation()
1501  	) + " | " + 
1502 		              		
1503 		              			"Team = " + String.valueOf(getTeam()
1504  	) + " | " + 
1505 		              		
1506 		              			"Weapon = " + String.valueOf(getWeapon()
1507  	) + " | " + 
1508 		              		
1509 		              			"Shooting = " + String.valueOf(isShooting()
1510  	) + " | " + 
1511 		              		
1512 		              			"Health = " + String.valueOf(getHealth()
1513  	) + " | " + 
1514 		              		
1515 		              			"PrimaryAmmo = " + String.valueOf(getPrimaryAmmo()
1516  	) + " | " + 
1517 		              		
1518 		              			"SecondaryAmmo = " + String.valueOf(getSecondaryAmmo()
1519  	) + " | " + 
1520 		              		
1521 		              			"Adrenaline = " + String.valueOf(getAdrenaline()
1522  	) + " | " + 
1523 		              		
1524 		              			"Armor = " + String.valueOf(getArmor()
1525  	) + " | " + 
1526 		              		
1527 		              			"SmallArmor = " + String.valueOf(getSmallArmor()
1528  	) + " | " + 
1529 		              		
1530 		              			"AltFiring = " + String.valueOf(isAltFiring()
1531  	) + " | " + 
1532 		              		
1533 		              			"Crouched = " + String.valueOf(isCrouched()
1534  	) + " | " + 
1535 		              		
1536 		              			"Walking = " + String.valueOf(isWalking()
1537  	) + " | " + 
1538 		              		
1539 		              			"FloorLocation = " + String.valueOf(getFloorLocation()
1540  	) + " | " + 
1541 		              		
1542 		              			"FloorNormal = " + String.valueOf(getFloorNormal()
1543  	) + " | " + 
1544 		              		
1545 		              			"Combo = " + String.valueOf(getCombo()
1546  	) + " | " + 
1547 		              		
1548 		              			"UDamageTime = " + String.valueOf(getUDamageTime()
1549  	) + " | " + 
1550 		              		
1551 		              			"Action = " + String.valueOf(getAction()
1552  	) + " | " + 
1553 		              		
1554 		              			"EmotLeft = " + String.valueOf(getEmotLeft()
1555  	) + " | " + 
1556 		              		
1557 		              			"EmotCenter = " + String.valueOf(getEmotCenter()
1558  	) + " | " + 
1559 		              		
1560 		              			"EmotRight = " + String.valueOf(getEmotRight()
1561  	) + " | " + 
1562 		              		
1563 		              			"Bubble = " + String.valueOf(getBubble()
1564  	) + " | " + 
1565 		              		
1566 		              			"Anim = " + String.valueOf(getAnim()
1567  	) + " | " + 
1568 		              		
1569 				"]";           		
1570         }
1571  	
1572  		
1573  		public String toHtmlString() {
1574  			return super.toString() + "[<br/>" +
1575             	
1576 		              			"<b>Id</b> = " + String.valueOf(getId()
1577  	) + " <br/> " + 
1578 		              		
1579 		              			"<b>BotId</b> = " + String.valueOf(getBotId()
1580  	) + " <br/> " + 
1581 		              		
1582 		              			"<b>Name</b> = " + String.valueOf(getName()
1583  	) + " <br/> " + 
1584 		              		
1585 		              			"<b>Vehicle</b> = " + String.valueOf(isVehicle()
1586  	) + " <br/> " + 
1587 		              		
1588 		              			"<b>Location</b> = " + String.valueOf(getLocation()
1589  	) + " <br/> " + 
1590 		              		
1591 		              			"<b>Velocity</b> = " + String.valueOf(getVelocity()
1592  	) + " <br/> " + 
1593 		              		
1594 		              			"<b>Rotation</b> = " + String.valueOf(getRotation()
1595  	) + " <br/> " + 
1596 		              		
1597 		              			"<b>Team</b> = " + String.valueOf(getTeam()
1598  	) + " <br/> " + 
1599 		              		
1600 		              			"<b>Weapon</b> = " + String.valueOf(getWeapon()
1601  	) + " <br/> " + 
1602 		              		
1603 		              			"<b>Shooting</b> = " + String.valueOf(isShooting()
1604  	) + " <br/> " + 
1605 		              		
1606 		              			"<b>Health</b> = " + String.valueOf(getHealth()
1607  	) + " <br/> " + 
1608 		              		
1609 		              			"<b>PrimaryAmmo</b> = " + String.valueOf(getPrimaryAmmo()
1610  	) + " <br/> " + 
1611 		              		
1612 		              			"<b>SecondaryAmmo</b> = " + String.valueOf(getSecondaryAmmo()
1613  	) + " <br/> " + 
1614 		              		
1615 		              			"<b>Adrenaline</b> = " + String.valueOf(getAdrenaline()
1616  	) + " <br/> " + 
1617 		              		
1618 		              			"<b>Armor</b> = " + String.valueOf(getArmor()
1619  	) + " <br/> " + 
1620 		              		
1621 		              			"<b>SmallArmor</b> = " + String.valueOf(getSmallArmor()
1622  	) + " <br/> " + 
1623 		              		
1624 		              			"<b>AltFiring</b> = " + String.valueOf(isAltFiring()
1625  	) + " <br/> " + 
1626 		              		
1627 		              			"<b>Crouched</b> = " + String.valueOf(isCrouched()
1628  	) + " <br/> " + 
1629 		              		
1630 		              			"<b>Walking</b> = " + String.valueOf(isWalking()
1631  	) + " <br/> " + 
1632 		              		
1633 		              			"<b>FloorLocation</b> = " + String.valueOf(getFloorLocation()
1634  	) + " <br/> " + 
1635 		              		
1636 		              			"<b>FloorNormal</b> = " + String.valueOf(getFloorNormal()
1637  	) + " <br/> " + 
1638 		              		
1639 		              			"<b>Combo</b> = " + String.valueOf(getCombo()
1640  	) + " <br/> " + 
1641 		              		
1642 		              			"<b>UDamageTime</b> = " + String.valueOf(getUDamageTime()
1643  	) + " <br/> " + 
1644 		              		
1645 		              			"<b>Action</b> = " + String.valueOf(getAction()
1646  	) + " <br/> " + 
1647 		              		
1648 		              			"<b>EmotLeft</b> = " + String.valueOf(getEmotLeft()
1649  	) + " <br/> " + 
1650 		              		
1651 		              			"<b>EmotCenter</b> = " + String.valueOf(getEmotCenter()
1652  	) + " <br/> " + 
1653 		              		
1654 		              			"<b>EmotRight</b> = " + String.valueOf(getEmotRight()
1655  	) + " <br/> " + 
1656 		              		
1657 		              			"<b>Bubble</b> = " + String.valueOf(getBubble()
1658  	) + " <br/> " + 
1659 		              		
1660 		              			"<b>Anim</b> = " + String.valueOf(getAnim()
1661  	) + " <br/> " + 
1662 		              		
1663 				"<br/>]";     
1664 		}
1665  	
1666  		
1667  		// --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=all]) ---
1668         	
1669 		// --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=all]) ---
1670 		
1671 	    // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=local+classtype[@name=impl]) ---
1672 	        
1673 	    // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=local+classtype[@name=impl]) ---        	            	
1674  	
1675 		}
1676