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=shared]+classtype[@name=abstract] BEGIN
13  		
14  		// --- IMPORTS FROM extra/code/java/javapart/classcategory[@name=shared]+classtype[@name=abstract] END
15      
16   		/**
17           *  
18              				Abstract definition of the shared part of the GameBots2004 message ENT.  
19              			
20           *
21           *  <p></p><p></p>
22           *  Complete message documentation:               
23           *  
24  		Generic physical entity that may be present in the world. Works as a hook for custom objects, such as new items from EmohawkRPG extension.
25  	
26           */
27   	public abstract class EntityShared 
28    						extends InfoMessage
29    						implements ISharedWorldObject
30    						
31  	    		,ILocated
32  	    {
33   	
34      	
35      	
36      	/**
37      	 * Parameter-less contructor for the message.
38      	 */
39  		public EntityShared()
40  		{
41  		}
42  		
43  				// abstract definition of the shared-part of the message, no more constructors is needed
44  			
45  	   		
46  			protected long SimTime;
47  				
48  			/**
49  			 * Simulation time in MILLI SECONDS !!!
50  			 */	
51  			@Override
52  			public long getSimTime() {
53  				return SimTime;
54  			}
55  						
56  			/**
57  			 * Used by Yylex to slip correct time of the object or programmatically.
58  			 */
59  			protected void setSimTime(long SimTime) {
60  				this.SimTime = SimTime;
61  			}
62  	   	
63  	    						public static final Token LocationPropertyToken = Tokens.get("Location");
64  	    					
65  	    						public static final Token RotationPropertyToken = Tokens.get("Rotation");
66  	    					
67  	    						public static final Token VelocityPropertyToken = Tokens.get("Velocity");
68  	    						
69  							
70  							public static final Set<Token> SharedPropertyTokens;
71  	
72  							static {
73  								Set<Token> tokens = new HashSet<Token>();
74  								
75  									tokens.add(LocationPropertyToken);
76  								
77  									tokens.add(RotationPropertyToken);
78  								
79  									tokens.add(VelocityPropertyToken);
80  								
81  								SharedPropertyTokens = Collections.unmodifiableSet(tokens);
82  							}
83  	    				
84  	    			
85  	    				@Override
86  		    			public abstract 
87  		    			EntityShared clone();
88  		    			
89  						@Override
90  						public Class getCompositeClass() {
91  							return Entity.class;
92  						}
93  	
94  						
95  		    			
96   		/**
97           * 
98  			Unique Id of the item. This Id represents some entity in the world.
99  		 
100          */
101         public abstract UnrealId getId()
102  	;
103 		    			
104  		/**
105          * Location of the item. 
106          */
107         public abstract Location getLocation()
108  	;
109 		    			
110  		/**
111          * Rotation of the item. 
112          */
113         public abstract Rotation getRotation()
114  	;
115 		    			
116  		/**
117          * Velocity of the item. 
118          */
119         public abstract Velocity getVelocity()
120  	;
121 		    			
122  		
123  	    public String toString() {
124             return
125             	super.toString() + "[" +
126             	
127 		              			"Id = " + String.valueOf(getId()
128  	) + " | " + 
129 		              		
130 		              			"Location = " + String.valueOf(getLocation()
131  	) + " | " + 
132 		              		
133 		              			"Rotation = " + String.valueOf(getRotation()
134  	) + " | " + 
135 		              		
136 		              			"Velocity = " + String.valueOf(getVelocity()
137  	) + " | " + 
138 		              		
139 				"]";           		
140         }
141  	
142  		
143  		public String toHtmlString() {
144  			return super.toString() + "[<br/>" +
145             	
146 		              			"<b>Id</b> = " + String.valueOf(getId()
147  	) + " <br/> " + 
148 		              		
149 		              			"<b>Location</b> = " + String.valueOf(getLocation()
150  	) + " <br/> " + 
151 		              		
152 		              			"<b>Rotation</b> = " + String.valueOf(getRotation()
153  	) + " <br/> " + 
154 		              		
155 		              			"<b>Velocity</b> = " + String.valueOf(getVelocity()
156  	) + " <br/> " + 
157 		              		
158 				"<br/>]";     
159 		}
160  	
161  		
162  		// --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=all]) ---
163         	
164 		// --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=all]) ---
165 		
166 	    // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=shared+classtype[@name=abstract]) ---
167 	        
168 	    // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=shared+classtype[@name=abstract]) ---        	            	
169  	
170 		}
171