
            /**
            IMPORTANT !!!
       
            DO NOT EDIT THIS FILE. IT IS GENERATED FROM approriate xml file in xmlresources/gbinfomessages BY
            THE JavaClassesGenerator.xslt. MODIFY THESE FILES INSTEAD OF THIS ONE.
       
            IMPORTANT END !!!
            */
            package
            cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages;
	    		import java.util.*;    
    import javax.vecmath.*;    
    import cz.cuni.amis.pogamut.base.communication.messages.*;    
    import cz.cuni.amis.pogamut.base.agent.worldview.*;    
    import cz.cuni.amis.pogamut.base.agent.worldview.objects.*;    
    import cz.cuni.amis.pogamut.base.communication.translator.*;    
    import cz.cuni.amis.pogamut.ut2004.communication.translator.itemdescriptor.*;    
    import cz.cuni.amis.pogamut.ut2004.communication.messages.ItemType.Category;    
    import cz.cuni.amis.pogamut.base.exceptions.*;    
    import cz.cuni.amis.pogamut.base3d.worldview.objects.*;    
    import cz.cuni.amis.pogamut.ut2004.communication.messages.*;    
    import cz.cuni.amis.pogamut.ut2004.agent.worldview.objects.*;    
                
            
            /**
              
		Both asynchronous and synchronous message. Incoming projectile that we can see.
	
                          Corresponding GameBots message is 
                          PRJ.
                      
             */
            
            public class
            IncommingProjectile
                    extends GBObjectUpdate
                
	            	implements IGBWorldObjectEvent, IWorldObject
                        
            {
            
            
            
    	/** Example how the message looks like - used during parser tests. */
    	public static final String PROTOTYPE = 
    		"PRJ {Id unreal_id} {Time 0} {Direction 0,0,0} {Location 0,0,0} {Velocity 0,0,0} {Speed 0} {Origin 0,0,0} {DamageRadius 0} {Type text}";
    
            
            /////// Properties BEGIN
            
        /**
        Unique Id of the projectile. */
        protected
         UnrealId Id = 
        	null;
        
        
        /**
        Unique Id of the projectile. */
        public
        UnrealId getId() {
            return
         Id;
        }
        

        
        /**
        Estimated time till impact. */
        protected
         double Time = 
        	0;
        
        
        /**
        Estimated time till impact. */
        public
        double getTime() {
            return
         Time;
        }
        

        
        /**
        
			Which direction projectile is heading to -> orientation
			vector.
		 */
        protected
         Vector3d Direction = 
        	null;
        
        
        /**
        
			Which direction projectile is heading to -> orientation
			vector.
		 */
        public
        Vector3d getDirection() {
            return
         Direction;
        }
        

        
        /**
        
			Current location of the projectile.
		 */
        protected
         Location Location = 
        	null;
        
        
        /**
        
			Current location of the projectile.
		 */
        public
        Location getLocation() {
            return
         Location;
        }
        

        
        /**
        
			Current velocity vector of the projectile.
		 */
        protected
         Velocity Velocity = 
        	null;
        
        
        /**
        
			Current velocity vector of the projectile.
		 */
        public
        Velocity getVelocity() {
            return
         Velocity;
        }
        

        
        /**
        
			Current speed of the projectile.
		 */
        protected
         double Speed = 
        	0;
        
        
        /**
        
			Current speed of the projectile.
		 */
        public
        double getSpeed() {
            return
         Speed;
        }
        

        
        /**
        
			Possition of the origin, when combined with direction can
			define the line of fire.
		 */
        protected
         Location Origin = 
        	null;
        
        
        /**
        
			Possition of the origin, when combined with direction can
			define the line of fire.
		 */
        public
        Location getOrigin() {
            return
         Origin;
        }
        

        
        /**
        
			If the projectile has splash damage, how big it is – in ut
			units.
		 */
        protected
         double DamageRadius = 
        	0;
        
        
        /**
        
			If the projectile has splash damage, how big it is – in ut
			units.
		 */
        public
        double getDamageRadius() {
            return
         DamageRadius;
        }
        

        
        /**
        
			The class of the projectile (so you know what is flying
			against you).
		 */
        protected
         String Type = 
        	null;
        
        
        /**
        
			The class of the projectile (so you know what is flying
			against you).
		 */
        public
        String getType() {
            return
         Type;
        }
        

        
            /////// Properties END
            
            /////// Extra Java code BEGIN
                        	
            	/////// Additional code from xslt BEGIN            	 
            		
       							protected void setTime(double time) {
       								this.Time = time;
       							}
       						
       							public double getLastSeenTime() {
       								return Time;
       							}
       						
       					
       					public boolean equals(Object obj) {
	                      if (!(obj instanceof IncommingProjectile)) return false;
	                      IncommingProjectile cast = (IncommingProjectile)obj;
	                      if (this.getId() != null) return this.getId().equals(cast.getId());
	                      else return cast.getId() == null;
	                    }
	                    
	                    public int hashCode() {
	                      if (getId() != null) return getId().hashCode();
	                      return 0;
	                    }
            			
            			
            		
            		
            	/////// Additional code from xslt END            
				                    
	            /////// Extra Java from XML BEGIN
            		
            	/////// Extra Java from XML END
            	    
            /////// Extra Java code END
            
            
            
            /**
              * Cloning constructor.
              */
             public IncommingProjectile(IncommingProjectile original) {
                
                     this.Id=original.Id;
                
                     this.Time=original.Time;
                
                     this.Direction=original.Direction;
                
                     this.Location=original.Location;
                
                     this.Velocity=original.Velocity;
                
                     this.Speed=original.Speed;
                
                     this.Origin=original.Origin;
                
                     this.DamageRadius=original.DamageRadius;
                
                     this.Type=original.Type;
                
             }   
             
             
                 /**
                  * Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
                  */
	             public IncommingProjectile() {
	             }
             
	    		
	    		/**
	    		 * Here we save the original object for which this object is an update.
	    		 */ 
	    		private IWorldObject orig = null;
	    		
	            public IWorldObject update(IWorldObject obj) {
		            if(obj == null) {
		               orig = this;
		               return this;
		            }
		            orig = obj;
		            // typecast
		            IncommingProjectile  o = (IncommingProjectile)obj;
		            
		            
		            
		            return o;
		        }
	        
	            /**
	             * Returns original object (if method update() has already been called, for bot-programmer that is always true
	             * as the original object is updated and then the event is propagated).
	             */ 
		        public IWorldObject getObject() {
		            if (orig == null) return this;
		            return orig;
		        }
	        
                
                 
            public String toString() {
                return
                
                		super.toString() + " | " +
                		
				               "Id = " + 
				               String.valueOf(Id) + " | " +
				            
				               "Time = " + 
				               String.valueOf(Time) + " | " +
				            
				               "Direction = " + 
				               String.valueOf(Direction) + " | " +
				            
				               "Location = " + 
				               String.valueOf(Location) + " | " +
				            
				               "Velocity = " + 
				               String.valueOf(Velocity) + " | " +
				            
				               "Speed = " + 
				               String.valueOf(Speed) + " | " +
				            
				               "Origin = " + 
				               String.valueOf(Origin) + " | " +
				            
				               "DamageRadius = " + 
				               String.valueOf(DamageRadius) + " | " +
				            
				               "Type = " + 
				               String.valueOf(Type) + " | " +
				             "";
                	 
             }
             
             public String toHtmlString() {
                return super.toString() +
             
            "<b>Id</b> : " + 
            String.valueOf(Id) + 
            " <br/> " +
             
            "<b>Time</b> : " + 
            String.valueOf(Time) + 
            " <br/> " +
             
            "<b>Direction</b> : " + 
            String.valueOf(Direction) + 
            " <br/> " +
             
            "<b>Location</b> : " + 
            String.valueOf(Location) + 
            " <br/> " +
             
            "<b>Velocity</b> : " + 
            String.valueOf(Velocity) + 
            " <br/> " +
             
            "<b>Speed</b> : " + 
            String.valueOf(Speed) + 
            " <br/> " +
             
            "<b>Origin</b> : " + 
            String.valueOf(Origin) + 
            " <br/> " +
             
            "<b>DamageRadius</b> : " + 
            String.valueOf(DamageRadius) + 
            " <br/> " +
             
            "<b>Type</b> : " + 
            String.valueOf(Type) + 
            " <br/> " +
             "";
             }            
             
             
             
             }
                         
        