
            /**
            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. NavPoint carries information about UT
		navigation point - location, reachability... Also some item can
		be respawned at this point. Or some additional information can
		be stored here (if it is an ambush point, or sniper point..).
	
                          Corresponding GameBots message is 
                          NAV.
                      
             */
            
            public class
            NavPoint
                    extends GBObjectUpdate
                
	            	implements IGBWorldObjectEvent, IWorldObject, ILocated, ILocomotive, IGBViewable
                        
            {
            
            
            
    	/** Example how the message looks like - used during parser tests. */
    	public static final String PROTOTYPE = 
    		"NAV {Id unreal_id} {Location 0,0,0} {Velocity 0,0,0} {Visible False} {Reachable False} {Item unreal_id} {ItemClass xWeapons.FlakCannonPickup} {Flag text} {Rotation 0,0,0} {RoamingSpot False} {SnipingSpot False} {PreferedWeapon text}";
    
            
            /////// Properties BEGIN
            
        /**
        
			A unique Id of this navigation point assigned by the game.
		 */
        protected
         UnrealId Id = 
        	null;
        
        
        /**
        
			A unique Id of this navigation point assigned by the game.
		 */
        public
        UnrealId getId() {
            return
         Id;
        }
        

        
        /**
        Location of navigation point. */
        protected
         Location Location = 
        	null;
        
        
        /**
        Location of navigation point. */
        public
        Location getLocation() {
            return
         Location;
        }
        

        
        /**
        
			Velocity of the navigation point (if the navigation point is
			currently moving).
		 */
        protected
         Velocity Velocity = 
        	null;
        
        
        /**
        
			Velocity of the navigation point (if the navigation point is
			currently moving).
		 */
        public
        Velocity getVelocity() {
            return
         Velocity;
        }
        

        
        /**
        
			If the point is in the field of view of the bot.
		 */
        protected
         boolean Visible = 
        	false;
        
        
        /**
        
			If the point is in the field of view of the bot.
		 */
        public
        boolean isVisible() {
            return
         Visible;
        }
        

        
        /**
        
			If the bot can reach the point directly.
		 */
        protected
         boolean Reachable = 
        	false;
        
        
        /**
        
			If the bot can reach the point directly.
		 */
        public
        boolean isReachable() {
            return
         Reachable;
        }
        

        
        /**
        
			Unique Id of the respawned item (the item respawns at this
			point).
		 */
        protected
         UnrealId Item = 
        	null;
        
        
        /**
        
			Unique Id of the respawned item (the item respawns at this
			point).
		 */
        public
        UnrealId getItem() {
            return
         Item;
        }
        

        
        /**
        
            Class of the item (e.g. xWeapons.FlakCannonPickup). "None" if no item is here.
         */
        protected
         ItemType ItemClass = 
        	null;
        
        
        /**
        
            Class of the item (e.g. xWeapons.FlakCannonPickup). "None" if no item is here.
         */
        public
        ItemType getItemClass() {
            return
         ItemClass;
        }
        

        
        /**
        
			What type is this NavPoint. The types are: PathNode,
			PlayerStart, InventorySpot and AIMarker. If the type is
			AIMarker, more attributes appear in NAV message - see below.
		 */
        protected
         String Flag = 
        	null;
        
        
        /**
        
			What type is this NavPoint. The types are: PathNode,
			PlayerStart, InventorySpot and AIMarker. If the type is
			AIMarker, more attributes appear in NAV message - see below.
		 */
        public
        String getFlag() {
            return
         Flag;
        }
        

        
        /**
        
			If the type is AIMarker. The rotation the bot should be
			facing, when doing the action specified by AIMarker.
		 */
        protected
         Rotation Rotation = 
        	null;
        
        
        /**
        
			If the type is AIMarker. The rotation the bot should be
			facing, when doing the action specified by AIMarker.
		 */
        public
        Rotation getRotation() {
            return
         Rotation;
        }
        

        
        /**
        
			Some ambush point, where is good chance to intercept
			approaching opponents.
		 */
        protected
         boolean RoamingSpot = 
        	false;
        
        
        /**
        
			Some ambush point, where is good chance to intercept
			approaching opponents.
		 */
        public
        boolean isRoamingSpot() {
            return
         RoamingSpot;
        }
        

        
        /**
        Point good for sniping. */
        protected
         boolean SnipingSpot = 
        	false;
        
        
        /**
        Point good for sniping. */
        public
        boolean isSnipingSpot() {
            return
         SnipingSpot;
        }
        

        
        /**
        If item should be present at this navpoint it's instance will be here. */
        protected
         Item ItemInstance = 
        	null;
        
        
        /**
        If item should be present at this navpoint it's instance will be here. */
        public
        Item getItemInstance() {
            return
         ItemInstance;
        }
        

        
        /**
        Maps edge-LEADING_TO-navpoint-UnrealId to neighbour link, those are outgoing edges (those edges that originates in this navpoint going to another one, those you may usually travel). */
        protected
         Map<UnrealId, NavPointNeighbourLink> OutgoingEdges = 
        	new HashMap<UnrealId, NavPointNeighbourLink>();
        
        
        /**
        Maps edge-LEADING_TO-navpoint-UnrealId to neighbour link, those are outgoing edges (those edges that originates in this navpoint going to another one, those you may usually travel). */
        public
        Map<UnrealId, NavPointNeighbourLink> getOutgoingEdges() {
            return
         OutgoingEdges;
        }
        

        
        /**
        Maps edge-ORIGINATES_FROM-navpoint-UnrealId to neighbour link, those are incoming edges (those edges that originates in different navpoint and ends here, do not use this to ask whether you can get to navpoint of specific unreal id, use OutgoingEdges instead). */
        protected
         Map<UnrealId, NavPointNeighbourLink> IncomingEdges = 
        	new HashMap<UnrealId, NavPointNeighbourLink>();
        
        
        /**
        Maps edge-ORIGINATES_FROM-navpoint-UnrealId to neighbour link, those are incoming edges (those edges that originates in different navpoint and ends here, do not use this to ask whether you can get to navpoint of specific unreal id, use OutgoingEdges instead). */
        public
        Map<UnrealId, NavPointNeighbourLink> getIncomingEdges() {
            return
         IncomingEdges;
        }
        

        
        /**
        
			Class of the weapon that should be prefered when using this
			point for AIMarker specified action.
		 */
        protected
         String PreferedWeapon = 
        	null;
        
        
        /**
        
			Class of the weapon that should be prefered when using this
			point for AIMarker specified action.
		 */
        public
        String getPreferedWeapon() {
            return
         PreferedWeapon;
        }
        

        
            /////// 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 NavPoint)) return false;
	                      NavPoint cast = (NavPoint)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
            		
			    /**
			     * Use to fill missing fields of the NavPoint when creating MapObtained event before
			     * INIT command is requested.
			     */ 
			    public NavPoint(
			      NavPoint orig,
			      Item itemInstance
			    ) {
			        this(orig);
			        this.ItemInstance = itemInstance;
			    } 
			      
			
            	/////// Extra Java from XML END
            	    
            /////// Extra Java code END
            
            
            
            /**
              * Cloning constructor.
              */
             public NavPoint(NavPoint original) {
                
                     this.Id=original.Id;
                
                     this.Location=original.Location;
                
                     this.Velocity=original.Velocity;
                
                     this.Visible=original.Visible;
                
                     this.Reachable=original.Reachable;
                
                     this.Item=original.Item;
                
                     this.ItemClass=original.ItemClass;
                
                     this.Flag=original.Flag;
                
                     this.Rotation=original.Rotation;
                
                     this.RoamingSpot=original.RoamingSpot;
                
                     this.SnipingSpot=original.SnipingSpot;
                
                     this.ItemInstance=original.ItemInstance;
                
                     this.OutgoingEdges=original.OutgoingEdges;
                
                     this.IncomingEdges=original.IncomingEdges;
                
                     this.PreferedWeapon=original.PreferedWeapon;
                
             }   
             
             
                 /**
                  * Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
                  */
	             public NavPoint() {
	             }
             
	    		
	    		     /**
	    		      * Used to drop Visible flag from the object.
	    		      */
	    		     public static class ObjectDisappeared implements IGBWorldObjectDisappeared {
	    		     
	    		         private IWorldObject orig;
	    		         
	    		         public ObjectDisappeared(IWorldObject orig) {
	    		             this.orig = orig;
	    		         }
	    		         
	    		         public IWorldObjectId getId() {
	    		             return orig.getId();
	    		         }
    
                         public IWorldObject update(IWorldObject obj) {
                            if (obj == null) {
                                throw new PogamutRuntimeException("not meant to create new object, probably wanted to update non-existing object of id: " + getId(), this);
                            }
                            if (!(obj instanceof NavPoint)) {
                                throw new PogamutRuntimeException("can't update object of class " + obj.getClass() + ", meant to update NavPoint", this);
                            } 
                            orig = obj;
                            NavPoint toUpdate = (NavPoint)obj;
                            toUpdate.Visible = false;
                            return toUpdate;
                         }
    
                         public IWorldObject getObject() {
                            return orig;
                         }
                         
                         public String toString() {
                            return "ObjectDisappeared[" + orig.getClass().getName().substring(getClass().getName().lastIndexOf(".")+1) + " " + orig.getId() + "]"; 
                         }
	    		         
	    		     }
	    		
	    		     /**
	    		      * Used to create event that drops the Visible flag of the item.
	    		      */
	    		     public NavPoint(NavPoint Original, boolean Visible) {
	    		         this(Original);
	    		         this.Visible = Visible;
	    		     }
	    		     
	    		     public IGBWorldObjectDisappeared createDisappearEvent() {
	    		         return new ObjectDisappeared(this);
	    		     }
	    		
	    		
	    		/**
	    		 * 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
		            NavPoint  o = (NavPoint)obj;
		            
		            
		                o.Location=Location;
		            
		                o.Velocity=Velocity;
		            
		                o.Visible=Visible;
		            
		                o.Reachable=Reachable;
		            
								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) + " | " +
				            
				               "Location = " + 
				               String.valueOf(Location) + " | " +
				            
				               "Velocity = " + 
				               String.valueOf(Velocity) + " | " +
				            
				               "Visible = " + 
				               String.valueOf(Visible) + " | " +
				            
				               "Reachable = " + 
				               String.valueOf(Reachable) + " | " +
				            
				               "Item = " + 
				               String.valueOf(Item) + " | " +
				            
				               "ItemClass = " + 
				               String.valueOf(ItemClass) + " | " +
				            
				               "Flag = " + 
				               String.valueOf(Flag) + " | " +
				            
				               "Rotation = " + 
				               String.valueOf(Rotation) + " | " +
				            
				               "RoamingSpot = " + 
				               String.valueOf(RoamingSpot) + " | " +
				            
				               "SnipingSpot = " + 
				               String.valueOf(SnipingSpot) + " | " +
				            
				               "PreferedWeapon = " + 
				               String.valueOf(PreferedWeapon) + " | " +
				             "";
                	 
             }
             
             public String toHtmlString() {
                return super.toString() +
             
            "<b>Id</b> : " + 
            String.valueOf(Id) + 
            " <br/> " +
             
            "<b>Location</b> : " + 
            String.valueOf(Location) + 
            " <br/> " +
             
            "<b>Velocity</b> : " + 
            String.valueOf(Velocity) + 
            " <br/> " +
             
            "<b>Visible</b> : " + 
            String.valueOf(Visible) + 
            " <br/> " +
             
            "<b>Reachable</b> : " + 
            String.valueOf(Reachable) + 
            " <br/> " +
             
            "<b>Item</b> : " + 
            String.valueOf(Item) + 
            " <br/> " +
             
            "<b>ItemClass</b> : " + 
            String.valueOf(ItemClass) + 
            " <br/> " +
             
            "<b>Flag</b> : " + 
            String.valueOf(Flag) + 
            " <br/> " +
             
            "<b>Rotation</b> : " + 
            String.valueOf(Rotation) + 
            " <br/> " +
             
            "<b>RoamingSpot</b> : " + 
            String.valueOf(RoamingSpot) + 
            " <br/> " +
             
            "<b>SnipingSpot</b> : " + 
            String.valueOf(SnipingSpot) + 
            " <br/> " +
             
            "<b>ItemInstance</b> : " + 
            String.valueOf(ItemInstance) + 
            " <br/> " +
             
            "<b>OutgoingEdges</b> : " + 
            String.valueOf(OutgoingEdges) + 
            " <br/> " +
             
            "<b>IncomingEdges</b> : " + 
            String.valueOf(IncomingEdges) + 
            " <br/> " +
             
            "<b>PreferedWeapon</b> : " + 
            String.valueOf(PreferedWeapon) + 
            " <br/> " +
             "";
             }            
             
             
             
             }
                         
        