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=local]+classtype[@name=abstract] BEGIN
13  		
14  		// --- IMPORTS FROM extra/code/java/javapart/classcategory[@name=local]+classtype[@name=abstract] END
15      
16   		/**
17           *  
18              				Abstract definition of the local part of the GameBots2004 message CONFCH.  
19              			
20           *
21           *  <p></p><p></p>
22           *  Complete message documentation:               
23           *  
24  		Asynchronous message. Message sent when the bot configuration
25  		changed - each agent has a lot of parameters affecting his state
26  		in the environment. See each property for the details.
27  	
28           */
29   	public abstract class ConfigChangeLocal 
30    						extends InfoMessage
31    						implements ILocalWorldObject
32    						
33  	    {
34   	
35      	
36      	
37      	/**
38      	 * Parameter-less contructor for the message.
39      	 */
40  		public ConfigChangeLocal()
41  		{
42  		}
43  		
44  				// abstract definition of the local-part of the message, no more constructors is needed
45  			
46  	   		
47  			protected long SimTime;
48  				
49  			/**
50  			 * Simulation time in MILLI SECONDS !!!
51  			 */	
52  			@Override
53  			public long getSimTime() {
54  				return SimTime;
55  			}
56  						
57  			/**
58  			 * Used by Yylex to slip correct time of the object or programmatically.
59  			 */
60  			protected void setSimTime(long SimTime) {
61  				this.SimTime = SimTime;
62  			}
63  	   	
64  	    			
65  	    				@Override
66  		    			public abstract 
67  		    			ConfigChangeLocal clone();
68  		    			
69  						@Override
70  						public Class getCompositeClass() {
71  							return ConfigChange.class;
72  						}
73  	
74  						
75  		    			
76   		/**
77           * Id of this config message. This Id is generated from BotId, string "_CONFCH" is added at the end. 
78           */
79          public abstract UnrealId getId()
80   	;
81  		    			
82   		/**
83           * Unique Id of the bot. 
84           */
85          public abstract UnrealId getBotId()
86   	;
87  		    			
88   		/**
89           * 
90  			True if we have to spawn the bot manually after each death
91  		 
92           */
93          public abstract boolean isManualSpawn()
94   	;
95  		    			
96   		/**
97           * 
98  			True if the bot is using auto ray tracing (is provided with
99  			synchronous ATR messages). See ATR messages for more
100 			details.
101 		 
102          */
103         public abstract boolean isAutoTrace()
104  	;
105 		    			
106  		/**
107          * The bot's name. 
108          */
109         public abstract String getName()
110  	;
111 		    			
112  		/**
113          * 
114 			Bots default speed will be multiplied by this number. Ranges from 0.1 to 2 (default, can be set in ini in [GameBots2004.RemoteBot] MaxSpeed).
115 		 
116          */
117         public abstract double getSpeedMultiplier()
118  	;
119 		    			
120  		/**
121          * 
122 			Bot rotation rate. Default rotation rate is: (Pitch=3072,Yaw=60000,Roll=2048) and may be configured in ini file in [GameBots2004.RemoteBot] DefaultRotationRate. (pitch - up/down, yaw - left/right, roll - equivalent of doing a cartwheel)
123 		 
124          */
125         public abstract Rotation getRotationRate()
126  	;
127 		    			
128  		/**
129          * 
130 			If bot is invulnerable (cannot die) or not.
131 		 
132          */
133         public abstract boolean isInvulnerable()
134  	;
135 		    			
136  		/**
137          * 
138 			The delay between two self message synchronous batches 
139 			(can range from 0.01 to 2 seconds). Will be used only if NewSelfBatchProtocol
140 			attribute is set to true in INIT message.
141 		 
142          */
143         public abstract double getSelfUpdateTime()
144  	;
145 		    			
146  		/**
147          * 
148 			The delay between two synchronous batches containing vision updates
149 			(can range from 0.1 to 2 seconds). If NewSelfBatchProtocol
150 			attribute is set to true in INIT message, more batch messages containing only
151 			SELF message will arrive between two vision update batches (containing PLR,PRJ,INV.. messages).
152 		 
153          */
154         public abstract double getVisionTime()
155  	;
156 		    			
157  		/**
158          * 
159 			Holds information how many times faster is exported location update message (UPD) compared to sync. batch, e.g. when this multiplier is set to 5 and vision time is 250 ms, UPD message will arrive every 50 ms.
160 		 
161          */
162         public abstract int getLocUpdateMultiplier()
163  	;
164 		    			
165  		/**
166          * 
167 			If some additional debug information will be shown in the
168 			UT2004 server console window.
169 		 
170          */
171         public abstract boolean isShowDebug()
172  	;
173 		    			
174  		/**
175          * 
176 			If true an actor visualizing the location the bot is
177 			actually looking at will appear in the game.
178 		 
179          */
180         public abstract boolean isShowFocalPoint()
181  	;
182 		    			
183  		/**
184          * 
185 			if the GB should draw lines representing the auto ray traces
186 			of the bot (for more information see ATR message).
187 		 
188          */
189         public abstract boolean isDrawTraceLines()
190  	;
191 		    			
192  		/**
193          * 
194 			It informs if sending of all GB synchronous messages is
195 			enabled or disabled.
196 		 
197          */
198         public abstract boolean isSynchronousOff()
199  	;
200 		    			
201  		/**
202          * 
203 			It enables/disables automatic pickup of the bot. If true the items can be picked up through PICK command.
204 		 
205          */
206         public abstract boolean isAutoPickupOff()
207  	;
208 		    			
209  		/**
210          * 
211 			Name of current BDI action.
212 		 
213          */
214         public abstract String getAction()
215  	;
216 		    			
217     	
218     	
219     	
220     	public ConfigChangeLocal getLocal() {
221 			return this;
222     	}
223 		public ISharedWorldObject getShared() {
224 		 	throw new UnsupportedOperationException("Could not return LOCAL");
225 		}
226 		public IStaticWorldObject getStatic() {
227 		    throw new UnsupportedOperationException("Could not return LOCAL");
228 		}
229  	
230  		
231  		
232  	    public String toString() {
233             return
234             	super.toString() + "[" +
235             	
236 		              			"Id = " + String.valueOf(getId()
237  	) + " | " + 
238 		              		
239 		              			"BotId = " + String.valueOf(getBotId()
240  	) + " | " + 
241 		              		
242 		              			"ManualSpawn = " + String.valueOf(isManualSpawn()
243  	) + " | " + 
244 		              		
245 		              			"AutoTrace = " + String.valueOf(isAutoTrace()
246  	) + " | " + 
247 		              		
248 		              			"Name = " + String.valueOf(getName()
249  	) + " | " + 
250 		              		
251 		              			"SpeedMultiplier = " + String.valueOf(getSpeedMultiplier()
252  	) + " | " + 
253 		              		
254 		              			"RotationRate = " + String.valueOf(getRotationRate()
255  	) + " | " + 
256 		              		
257 		              			"Invulnerable = " + String.valueOf(isInvulnerable()
258  	) + " | " + 
259 		              		
260 		              			"SelfUpdateTime = " + String.valueOf(getSelfUpdateTime()
261  	) + " | " + 
262 		              		
263 		              			"VisionTime = " + String.valueOf(getVisionTime()
264  	) + " | " + 
265 		              		
266 		              			"LocUpdateMultiplier = " + String.valueOf(getLocUpdateMultiplier()
267  	) + " | " + 
268 		              		
269 		              			"ShowDebug = " + String.valueOf(isShowDebug()
270  	) + " | " + 
271 		              		
272 		              			"ShowFocalPoint = " + String.valueOf(isShowFocalPoint()
273  	) + " | " + 
274 		              		
275 		              			"DrawTraceLines = " + String.valueOf(isDrawTraceLines()
276  	) + " | " + 
277 		              		
278 		              			"SynchronousOff = " + String.valueOf(isSynchronousOff()
279  	) + " | " + 
280 		              		
281 		              			"AutoPickupOff = " + String.valueOf(isAutoPickupOff()
282  	) + " | " + 
283 		              		
284 		              			"Action = " + String.valueOf(getAction()
285  	) + " | " + 
286 		              		
287 				"]";           		
288         }
289  	
290  		
291  		public String toHtmlString() {
292  			return super.toString() + "[<br/>" +
293             	
294 		              			"<b>Id</b> = " + String.valueOf(getId()
295  	) + " <br/> " + 
296 		              		
297 		              			"<b>BotId</b> = " + String.valueOf(getBotId()
298  	) + " <br/> " + 
299 		              		
300 		              			"<b>ManualSpawn</b> = " + String.valueOf(isManualSpawn()
301  	) + " <br/> " + 
302 		              		
303 		              			"<b>AutoTrace</b> = " + String.valueOf(isAutoTrace()
304  	) + " <br/> " + 
305 		              		
306 		              			"<b>Name</b> = " + String.valueOf(getName()
307  	) + " <br/> " + 
308 		              		
309 		              			"<b>SpeedMultiplier</b> = " + String.valueOf(getSpeedMultiplier()
310  	) + " <br/> " + 
311 		              		
312 		              			"<b>RotationRate</b> = " + String.valueOf(getRotationRate()
313  	) + " <br/> " + 
314 		              		
315 		              			"<b>Invulnerable</b> = " + String.valueOf(isInvulnerable()
316  	) + " <br/> " + 
317 		              		
318 		              			"<b>SelfUpdateTime</b> = " + String.valueOf(getSelfUpdateTime()
319  	) + " <br/> " + 
320 		              		
321 		              			"<b>VisionTime</b> = " + String.valueOf(getVisionTime()
322  	) + " <br/> " + 
323 		              		
324 		              			"<b>LocUpdateMultiplier</b> = " + String.valueOf(getLocUpdateMultiplier()
325  	) + " <br/> " + 
326 		              		
327 		              			"<b>ShowDebug</b> = " + String.valueOf(isShowDebug()
328  	) + " <br/> " + 
329 		              		
330 		              			"<b>ShowFocalPoint</b> = " + String.valueOf(isShowFocalPoint()
331  	) + " <br/> " + 
332 		              		
333 		              			"<b>DrawTraceLines</b> = " + String.valueOf(isDrawTraceLines()
334  	) + " <br/> " + 
335 		              		
336 		              			"<b>SynchronousOff</b> = " + String.valueOf(isSynchronousOff()
337  	) + " <br/> " + 
338 		              		
339 		              			"<b>AutoPickupOff</b> = " + String.valueOf(isAutoPickupOff()
340  	) + " <br/> " + 
341 		              		
342 		              			"<b>Action</b> = " + String.valueOf(getAction()
343  	) + " <br/> " + 
344 		              		
345 				"<br/>]";     
346 		}
347  	
348  		
349  		// --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=all]) ---
350         	
351 		// --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=all]) ---
352 		
353 	    // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=local+classtype[@name=abstract]) ---
354 	        
355 	    // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=local+classtype[@name=abstract]) ---        	            	
356  	
357 		}
358