
            /**
            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. Movers can be doors, elevators, or any
		other chunk of architecture that can move. They generally need
		to be either run into, or activated by shooting or pressing a
		button. We are working on ways to provide bots with more of the
		information they need to deal with movers appropriately.
	
                          Corresponding GameBots message is 
                          MOV.
                      
             */
            
            public class
            Mover
                    extends GBObjectUpdate
                
	            	implements IGBWorldObjectEvent, IWorldObject, ILocated, ILocomotive, IGBViewable
                        
            {
            
            
            
    	/** Example how the message looks like - used during parser tests. */
    	public static final String PROTOTYPE = 
    		"MOV {Id unreal_id} {Location 0,0,0} {Visible False} {Reachable False} {DamageTrig False} {Type text} {IsMoving False} {Velocity 0,0,0}";
    
            
            /////// Properties BEGIN
            
        /**
        
			A unique Id of this mover assigned by the game.
		 */
        protected
         UnrealId Id = 
        	null;
        
        
        /**
        
			A unique Id of this mover assigned by the game.
		 */
        public
        UnrealId getId() {
            return
         Id;
        }
        

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

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

        
        /**
        
			True if the bot can run here, false otherwise.
		 */
        protected
         boolean Reachable = 
        	false;
        
        
        /**
        
			True if the bot can run here, false otherwise.
		 */
        public
        boolean isReachable() {
            return
         Reachable;
        }
        

        
        /**
        
			True if the mover needs to be shot to be activated.
		 */
        protected
         boolean DamageTrig = 
        	false;
        
        
        /**
        
			True if the mover needs to be shot to be activated.
		 */
        public
        boolean isDamageTrig() {
            return
         DamageTrig;
        }
        

        
        /**
        String class of the mover. */
        protected
         String Type = 
        	null;
        
        
        /**
        String class of the mover. */
        public
        String getType() {
            return
         Type;
        }
        

        
        /**
        Does the mover move right now? */
        protected
         boolean IsMoving = 
        	false;
        
        
        /**
        Does the mover move right now? */
        public
        boolean isIsMoving() {
            return
         IsMoving;
        }
        

        
        /**
        Velocity vector. */
        protected
         Velocity Velocity = 
        	null;
        
        
        /**
        Velocity vector. */
        public
        Velocity getVelocity() {
            return
         Velocity;
        }
        

        
            /////// 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 Mover)) return false;
	                      Mover cast = (Mover)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 Mover(Mover original) {
                
                     this.Id=original.Id;
                
                     this.Location=original.Location;
                
                     this.Visible=original.Visible;
                
                     this.Reachable=original.Reachable;
                
                     this.DamageTrig=original.DamageTrig;
                
                     this.Type=original.Type;
                
                     this.IsMoving=original.IsMoving;
                
                     this.Velocity=original.Velocity;
                
             }   
             
             
                 /**
                  * Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
                  */
	             public Mover() {
	             }
             
	    		
	    		     /**
	    		      * 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 Mover)) {
                                throw new PogamutRuntimeException("can't update object of class " + obj.getClass() + ", meant to update Mover", this);
                            } 
                            orig = obj;
                            Mover toUpdate = (Mover)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 Mover(Mover 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
		            Mover  o = (Mover)obj;
		            
		            
		                o.Location=Location;
		            
		                o.Visible=Visible;
		            
		                o.Reachable=Reachable;
		            
		                o.IsMoving=IsMoving;
		            
		                o.Velocity=Velocity;
		            
								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) + " | " +
				            
				               "Visible = " + 
				               String.valueOf(Visible) + " | " +
				            
				               "Reachable = " + 
				               String.valueOf(Reachable) + " | " +
				            
				               "DamageTrig = " + 
				               String.valueOf(DamageTrig) + " | " +
				            
				               "Type = " + 
				               String.valueOf(Type) + " | " +
				            
				               "IsMoving = " + 
				               String.valueOf(IsMoving) + " | " +
				            
				               "Velocity = " + 
				               String.valueOf(Velocity) + " | " +
				             "";
                	 
             }
             
             public String toHtmlString() {
                return super.toString() +
             
            "<b>Id</b> : " + 
            String.valueOf(Id) + 
            " <br/> " +
             
            "<b>Location</b> : " + 
            String.valueOf(Location) + 
            " <br/> " +
             
            "<b>Visible</b> : " + 
            String.valueOf(Visible) + 
            " <br/> " +
             
            "<b>Reachable</b> : " + 
            String.valueOf(Reachable) + 
            " <br/> " +
             
            "<b>DamageTrig</b> : " + 
            String.valueOf(DamageTrig) + 
            " <br/> " +
             
            "<b>Type</b> : " + 
            String.valueOf(Type) + 
            " <br/> " +
             
            "<b>IsMoving</b> : " + 
            String.valueOf(IsMoving) + 
            " <br/> " +
             
            "<b>Velocity</b> : " + 
            String.valueOf(Velocity) + 
            " <br/> " +
             "";
             }            
             
             
             
             }
                         
        