
            /**
            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.*;    
                
            
            /**
              
		Synchronous message. Contains the results of automatically
		casted rays. One ATR message is for one casted ray. New
		automatically casted rays can be defined by ADDRAY command and
		removed by REMOVERAY command.
	
                          Corresponding GameBots message is 
                          ATR.
                      
             */
            
            public class
            AutoTraceRay
                    extends GBObjectUpdate
                
	            	implements IGBWorldObjectEvent, IWorldObject
                        
            {
            
            
            
    	/** Example how the message looks like - used during parser tests. */
    	public static final String PROTOTYPE = 
    		"ATR {Id null} {From 0,0,0} {To 0,0,0} {FastTrace False} {FloorCorrection False} {Result False} {HitNormal 0,0,0} {HitLocation 0,0,0} {TraceActors False} {HitID unreal_id}";
    
            
            /////// Properties BEGIN
            
        /**
        
			An Id for this ray (should be unique), assigned by the user
			when adding ray.
		 */
        protected
         StringId Id = 
        	null;
        
        
        /**
        
			An Id for this ray (should be unique), assigned by the user
			when adding ray.
		 */
        public
        StringId getId() {
            return
         Id;
        }
        

        
        /**
        
			Location from which the ray is emitted.
		 */
        protected
         Location From = 
        	null;
        
        
        /**
        
			Location from which the ray is emitted.
		 */
        public
        Location getFrom() {
            return
         From;
        }
        

        
        /**
        
			Location to which the ray is sent.
		 */
        protected
         Location To = 
        	null;
        
        
        /**
        
			Location to which the ray is sent.
		 */
        public
        Location getTo() {
            return
         To;
        }
        

        
        /**
        
			True if it is a fast trace, false if not (fast trace is a
			bit faster version of UT2004 ray trace - but provides us
			with less information - just true/false if we hit something
			on the way or not).
		 */
        protected
         boolean FastTrace = 
        	false;
        
        
        /**
        
			True if it is a fast trace, false if not (fast trace is a
			bit faster version of UT2004 ray trace - but provides us
			with less information - just true/false if we hit something
			on the way or not).
		 */
        public
        boolean isFastTrace() {
            return
         FastTrace;
        }
        

        
        /**
        
      If we should correct ray directions accoring floor normal. Note: Has issue - we can't set set rays up or down when correction is active.
		 */
        protected
         boolean FloorCorrection = 
        	false;
        
        
        /**
        
      If we should correct ray directions accoring floor normal. Note: Has issue - we can't set set rays up or down when correction is active.
		 */
        public
        boolean isFloorCorrection() {
            return
         FloorCorrection;
        }
        

        
        /**
        
			True if it hit something, false if not.
		 */
        protected
         boolean Result = 
        	false;
        
        
        /**
        
			True if it hit something, false if not.
		 */
        public
        boolean isResult() {
            return
         Result;
        }
        

        
        /**
        
			Vector with normal of the plane we have hit (not sent if
			FastTrace is True).
		 */
        protected
         Vector3d HitNormal = 
        	null;
        
        
        /**
        
			Vector with normal of the plane we have hit (not sent if
			FastTrace is True).
		 */
        public
        Vector3d getHitNormal() {
            return
         HitNormal;
        }
        

        
        /**
        
			Vector with location of the collision (not sent if FastTrace
			is True).
		 */
        protected
         Location HitLocation = 
        	null;
        
        
        /**
        
			Vector with location of the collision (not sent if FastTrace
			is True).
		 */
        public
        Location getHitLocation() {
            return
         HitLocation;
        }
        

        
        /**
        
			If we traced also actors with this ray (actors – moving
			things in a game – bots, players, monsters, pickup …) (only
			if NOT using FastTrace)
		 */
        protected
         boolean TraceActors = 
        	false;
        
        
        /**
        
			If we traced also actors with this ray (actors – moving
			things in a game – bots, players, monsters, pickup …) (only
			if NOT using FastTrace)
		 */
        public
        boolean isTraceActors() {
            return
         TraceActors;
        }
        

        
        /**
        
			Id of the actor we have hit. (Sent if FastTrace is False and
			TraceActors is True).
		 */
        protected
         UnrealId HitID = 
        	null;
        
        
        /**
        
			Id of the actor we have hit. (Sent if FastTrace is False and
			TraceActors is True).
		 */
        public
        UnrealId getHitID() {
            return
         HitID;
        }
        

        
            /////// Properties END
            
            /////// Extra Java code BEGIN
                        	
            	/////// Additional code from xslt BEGIN            	 
            		
       							protected double Time = 0;
       							
       							protected double getTime() {
       								return Time;
       							}
       							
       							protected void setTime(double time) {
       								this.Time = time;
       							}
       						
       							public double getLastSeenTime() {
       								return Time;
       							}
       						
       					
       					public boolean equals(Object obj) {
	                      if (!(obj instanceof AutoTraceRay)) return false;
	                      AutoTraceRay cast = (AutoTraceRay)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 AutoTraceRay(AutoTraceRay original) {
                
                     this.Id=original.Id;
                
                     this.From=original.From;
                
                     this.To=original.To;
                
                     this.FastTrace=original.FastTrace;
                
                     this.FloorCorrection=original.FloorCorrection;
                
                     this.Result=original.Result;
                
                     this.HitNormal=original.HitNormal;
                
                     this.HitLocation=original.HitLocation;
                
                     this.TraceActors=original.TraceActors;
                
                     this.HitID=original.HitID;
                
             }   
             
             
                 /**
                  * Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
                  */
	             public AutoTraceRay() {
	             }
             
	    		
	    		/**
	    		 * 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
		            AutoTraceRay  o = (AutoTraceRay)obj;
		            
		            
		                o.From=From;
		            
		                o.To=To;
		            
		                o.FastTrace=FastTrace;
		            
		                o.FloorCorrection=FloorCorrection;
		            
		                o.Result=Result;
		            
		                o.HitNormal=HitNormal;
		            
		                o.HitLocation=HitLocation;
		            
		                o.TraceActors=TraceActors;
		            
		                o.HitID=HitID;
		            
								o.Time = Time;
							
		            
		            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) + " | " +
				            
				               "From = " + 
				               String.valueOf(From) + " | " +
				            
				               "To = " + 
				               String.valueOf(To) + " | " +
				            
				               "FastTrace = " + 
				               String.valueOf(FastTrace) + " | " +
				            
				               "FloorCorrection = " + 
				               String.valueOf(FloorCorrection) + " | " +
				            
				               "Result = " + 
				               String.valueOf(Result) + " | " +
				            
				               "HitNormal = " + 
				               String.valueOf(HitNormal) + " | " +
				            
				               "HitLocation = " + 
				               String.valueOf(HitLocation) + " | " +
				            
				               "TraceActors = " + 
				               String.valueOf(TraceActors) + " | " +
				            
				               "HitID = " + 
				               String.valueOf(HitID) + " | " +
				             "";
                	 
             }
             
             public String toHtmlString() {
                return super.toString() +
             
            "<b>Id</b> : " + 
            String.valueOf(Id) + 
            " <br/> " +
             
            "<b>From</b> : " + 
            String.valueOf(From) + 
            " <br/> " +
             
            "<b>To</b> : " + 
            String.valueOf(To) + 
            " <br/> " +
             
            "<b>FastTrace</b> : " + 
            String.valueOf(FastTrace) + 
            " <br/> " +
             
            "<b>FloorCorrection</b> : " + 
            String.valueOf(FloorCorrection) + 
            " <br/> " +
             
            "<b>Result</b> : " + 
            String.valueOf(Result) + 
            " <br/> " +
             
            "<b>HitNormal</b> : " + 
            String.valueOf(HitNormal) + 
            " <br/> " +
             
            "<b>HitLocation</b> : " + 
            String.valueOf(HitLocation) + 
            " <br/> " +
             
            "<b>TraceActors</b> : " + 
            String.valueOf(TraceActors) + 
            " <br/> " +
             
            "<b>HitID</b> : " + 
            String.valueOf(HitID) + 
            " <br/> " +
             "";
             }            
             
             
             
             }
                         
        