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 synchronous batches (can range from
139 			0.1 to 2 seconds).
140 		 
141          */
142         public abstract double getVisionTime()
143  	;
144 		    			
145  		/**
146          * 
147 			If some additional debug information will be shown in the
148 			UT2004 server console window.
149 		 
150          */
151         public abstract boolean isShowDebug()
152  	;
153 		    			
154  		/**
155          * 
156 			If true an actor visualizing the location the bot is
157 			actually looking at will appear in the game.
158 		 
159          */
160         public abstract boolean isShowFocalPoint()
161  	;
162 		    			
163  		/**
164          * 
165 			if the GB should draw lines representing the auto ray traces
166 			of the bot (for more information see ATR message).
167 		 
168          */
169         public abstract boolean isDrawTraceLines()
170  	;
171 		    			
172  		/**
173          * 
174 			It informs if sending of all GB synchronous messages is
175 			enabled or disabled.
176 		 
177          */
178         public abstract boolean isSynchronousOff()
179  	;
180 		    			
181  		/**
182          * 
183 			It enables/disables automatic pickup of the bot. If true the items can be picked up through PICK command.
184 		 
185          */
186         public abstract boolean isAutoPickupOff()
187  	;
188 		    			
189  		/**
190          * 
191 			Name of current BDI action.
192 		 
193          */
194         public abstract String getAction()
195  	;
196 		    			
197     	
198     	
199     	
200     	public ConfigChangeLocal getLocal() {
201 			return this;
202     	}
203 		public ISharedWorldObject getShared() {
204 		 	throw new UnsupportedOperationException("Could not return LOCAL");
205 		}
206 		public IStaticWorldObject getStatic() {
207 		    throw new UnsupportedOperationException("Could not return LOCAL");
208 		}
209  	
210  		
211  		
212  	    public String toString() {
213             return
214             	super.toString() + "[" +
215             	
216 		              			"Id = " + String.valueOf(getId()
217  	) + " | " + 
218 		              		
219 		              			"BotId = " + String.valueOf(getBotId()
220  	) + " | " + 
221 		              		
222 		              			"ManualSpawn = " + String.valueOf(isManualSpawn()
223  	) + " | " + 
224 		              		
225 		              			"AutoTrace = " + String.valueOf(isAutoTrace()
226  	) + " | " + 
227 		              		
228 		              			"Name = " + String.valueOf(getName()
229  	) + " | " + 
230 		              		
231 		              			"SpeedMultiplier = " + String.valueOf(getSpeedMultiplier()
232  	) + " | " + 
233 		              		
234 		              			"RotationRate = " + String.valueOf(getRotationRate()
235  	) + " | " + 
236 		              		
237 		              			"Invulnerable = " + String.valueOf(isInvulnerable()
238  	) + " | " + 
239 		              		
240 		              			"VisionTime = " + String.valueOf(getVisionTime()
241  	) + " | " + 
242 		              		
243 		              			"ShowDebug = " + String.valueOf(isShowDebug()
244  	) + " | " + 
245 		              		
246 		              			"ShowFocalPoint = " + String.valueOf(isShowFocalPoint()
247  	) + " | " + 
248 		              		
249 		              			"DrawTraceLines = " + String.valueOf(isDrawTraceLines()
250  	) + " | " + 
251 		              		
252 		              			"SynchronousOff = " + String.valueOf(isSynchronousOff()
253  	) + " | " + 
254 		              		
255 		              			"AutoPickupOff = " + String.valueOf(isAutoPickupOff()
256  	) + " | " + 
257 		              		
258 		              			"Action = " + String.valueOf(getAction()
259  	) + " | " + 
260 		              		
261 				"]";           		
262         }
263  	
264  		
265  		public String toHtmlString() {
266  			return super.toString() + "[<br/>" +
267             	
268 		              			"<b>Id</b> = " + String.valueOf(getId()
269  	) + " <br/> " + 
270 		              		
271 		              			"<b>BotId</b> = " + String.valueOf(getBotId()
272  	) + " <br/> " + 
273 		              		
274 		              			"<b>ManualSpawn</b> = " + String.valueOf(isManualSpawn()
275  	) + " <br/> " + 
276 		              		
277 		              			"<b>AutoTrace</b> = " + String.valueOf(isAutoTrace()
278  	) + " <br/> " + 
279 		              		
280 		              			"<b>Name</b> = " + String.valueOf(getName()
281  	) + " <br/> " + 
282 		              		
283 		              			"<b>SpeedMultiplier</b> = " + String.valueOf(getSpeedMultiplier()
284  	) + " <br/> " + 
285 		              		
286 		              			"<b>RotationRate</b> = " + String.valueOf(getRotationRate()
287  	) + " <br/> " + 
288 		              		
289 		              			"<b>Invulnerable</b> = " + String.valueOf(isInvulnerable()
290  	) + " <br/> " + 
291 		              		
292 		              			"<b>VisionTime</b> = " + String.valueOf(getVisionTime()
293  	) + " <br/> " + 
294 		              		
295 		              			"<b>ShowDebug</b> = " + String.valueOf(isShowDebug()
296  	) + " <br/> " + 
297 		              		
298 		              			"<b>ShowFocalPoint</b> = " + String.valueOf(isShowFocalPoint()
299  	) + " <br/> " + 
300 		              		
301 		              			"<b>DrawTraceLines</b> = " + String.valueOf(isDrawTraceLines()
302  	) + " <br/> " + 
303 		              		
304 		              			"<b>SynchronousOff</b> = " + String.valueOf(isSynchronousOff()
305  	) + " <br/> " + 
306 		              		
307 		              			"<b>AutoPickupOff</b> = " + String.valueOf(isAutoPickupOff()
308  	) + " <br/> " + 
309 		              		
310 		              			"<b>Action</b> = " + String.valueOf(getAction()
311  	) + " <br/> " + 
312 		              		
313 				"<br/>]";     
314 		}
315  	
316  		
317  		// --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=all]) ---
318         	
319 		// --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=all]) ---
320 		
321 	    // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=local+classtype[@name=abstract]) ---
322 	        
323 	    // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=local+classtype[@name=abstract]) ---        	            	
324  	
325 		}
326