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 INITED.  
19              			
20           *
21           *  <p></p><p></p>
22           *  Complete message documentation:               
23           *  
24  		Asynchronous message. Sent after succesfull init command (so usually just once). 
25  		Holds many attributes of the bots like speed, id starting and max health, etc.
26  		Some attributes are not used due to GameBots mechanics.
27  	
28           */
29   	public abstract class InitedMessageLocal 
30    						extends InfoMessage
31    						implements ILocalWorldObject
32    						
33  	    {
34   	
35      	
36      	
37      	/**
38      	 * Parameter-less contructor for the message.
39      	 */
40  		public InitedMessageLocal()
41  		{
42  		}
43  		
44  				// abstract definition of the local-part of the message, no more constructors is needed
45  			
46  						
47  						public static final UnrealId InitedMessageId = UnrealId.get("InitedMessageId");
48  					
49  						
50  						public UnrealId getId() {						
51  							return cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage.InitedMessageId;
52  						}
53  					
54  	   		
55  			protected long SimTime;
56  				
57  			/**
58  			 * Simulation time in MILLI SECONDS !!!
59  			 */	
60  			@Override
61  			public long getSimTime() {
62  				return SimTime;
63  			}
64  						
65  			/**
66  			 * Used by Yylex to slip correct time of the object or programmatically.
67  			 */
68  			protected void setSimTime(long SimTime) {
69  				this.SimTime = SimTime;
70  			}
71  	   	
72  	    			
73  	    				@Override
74  		    			public abstract 
75  		    			InitedMessageLocal clone();
76  		    			
77  						@Override
78  						public Class getCompositeClass() {
79  							return InitedMessage.class;
80  						}
81  	
82  						
83  		    			
84   		/**
85           * 
86  			A unique unreal Id of the new bot.
87  		 
88           */
89          public abstract UnrealId getBotId()
90   	;
91  		    			
92   		/**
93           * 
94  			Bot will always start with this health amount (usually 100). 
95  		 
96           */
97          public abstract int getHealthStart()
98   	;
99  		    			
100  		/**
101          * 
102 			Full health of the bot (usually 100).
103 		 
104          */
105         public abstract int getHealthFull()
106  	;
107 		    			
108  		/**
109          * 
110 			Maximum health of the bot (default 199).
111 		 
112          */
113         public abstract int getHealthMax()
114  	;
115 		    			
116  		/**
117          * 
118 			Amount of adrenaline at the start. Usually 0.
119 		 
120          */
121         public abstract double getAdrenalineStart()
122  	;
123 		    			
124  		/**
125          * 
126 			Maxium amount of the adrenaline. Usually 100 (this can trigger the combos).
127 		 
128          */
129         public abstract double getAdrenalineMax()
130  	;
131 		    			
132  		/**
133          * 
134 			Starting strength of the bot armor (usually 0).
135 		 
136          */
137         public abstract int getShieldStrengthStart()
138  	;
139 		    			
140  		/**
141          * 
142 			Maximum strength of the bot armor (usually 150).
143 		 
144          */
145         public abstract int getShieldStrengthMax()
146  	;
147 		    			
148  		/**
149          * 
150 			Maximum amount of succesing jumps. Currently limited to double jump in GB.
151 		 
152          */
153         public abstract int getMaxMultiJump()
154  	;
155 		    			
156  		/**
157          * 
158 			Damage scaling for this bot. (he will deal reduced damage depending on the setting).
159 		 
160          */
161         public abstract double getDamageScaling()
162  	;
163 		    			
164  		/**
165          * 
166 			Groundspeed of the bot (on the ground). Default 440.
167 		 
168          */
169         public abstract double getGroundSpeed()
170  	;
171 		    			
172  		/**
173          * 
174 			Waterspeed of the bot (in the water).
175 		 
176          */
177         public abstract double getWaterSpeed()
178  	;
179 		    			
180  		/**
181          * 
182 			AirSpeed of the bot (in the air).
183 		 
184          */
185         public abstract double getAirSpeed()
186  	;
187 		    			
188  		/**
189          * 
190 			Ladderspeed of the bot (on the ladder).
191 		 
192          */
193         public abstract double getLadderSpeed()
194  	;
195 		    			
196  		/**
197          * 
198 			Accelartion rate of this bot. How fast he accelerates.
199 		 
200          */
201         public abstract double getAccelRate()
202  	;
203 		    			
204  		/**
205          * 
206 			 Bot Jump's Z boost.
207 		 
208          */
209         public abstract double getJumpZ()
210  	;
211 		    			
212  		/**
213          * 
214 			Not used in GB.
215 		 
216          */
217         public abstract double getMultiJumpBoost()
218  	;
219 		    			
220  		/**
221          * 
222 			 Max fall speed of the bot.
223 		 
224          */
225         public abstract double getMaxFallSpeed()
226  	;
227 		    			
228  		/**
229          * 
230 			Dodge speed factor.
231 		 
232          */
233         public abstract double getDodgeSpeedFactor()
234  	;
235 		    			
236  		/**
237          * 
238 			Dodge jump Z boost of the bot. 
239 		 
240          */
241         public abstract double getDodgeSpeedZ()
242  	;
243 		    			
244  		/**
245          * 
246 			How well can be the bot controlled in the air (ranges from 0 to 1).
247 		 
248          */
249         public abstract double getAirControl()
250  	;
251 		    			
252     	
253     	
254     	
255     	public InitedMessageLocal getLocal() {
256 			return this;
257     	}
258 		public ISharedWorldObject getShared() {
259 		 	throw new UnsupportedOperationException("Could not return LOCAL");
260 		}
261 		public IStaticWorldObject getStatic() {
262 		    throw new UnsupportedOperationException("Could not return LOCAL");
263 		}
264  	
265  		
266  		
267  	    public String toString() {
268             return
269             	super.toString() + "[" +
270             	
271 		              			"BotId = " + String.valueOf(getBotId()
272  	) + " | " + 
273 		              		
274 		              			"HealthStart = " + String.valueOf(getHealthStart()
275  	) + " | " + 
276 		              		
277 		              			"HealthFull = " + String.valueOf(getHealthFull()
278  	) + " | " + 
279 		              		
280 		              			"HealthMax = " + String.valueOf(getHealthMax()
281  	) + " | " + 
282 		              		
283 		              			"AdrenalineStart = " + String.valueOf(getAdrenalineStart()
284  	) + " | " + 
285 		              		
286 		              			"AdrenalineMax = " + String.valueOf(getAdrenalineMax()
287  	) + " | " + 
288 		              		
289 		              			"ShieldStrengthStart = " + String.valueOf(getShieldStrengthStart()
290  	) + " | " + 
291 		              		
292 		              			"ShieldStrengthMax = " + String.valueOf(getShieldStrengthMax()
293  	) + " | " + 
294 		              		
295 		              			"MaxMultiJump = " + String.valueOf(getMaxMultiJump()
296  	) + " | " + 
297 		              		
298 		              			"DamageScaling = " + String.valueOf(getDamageScaling()
299  	) + " | " + 
300 		              		
301 		              			"GroundSpeed = " + String.valueOf(getGroundSpeed()
302  	) + " | " + 
303 		              		
304 		              			"WaterSpeed = " + String.valueOf(getWaterSpeed()
305  	) + " | " + 
306 		              		
307 		              			"AirSpeed = " + String.valueOf(getAirSpeed()
308  	) + " | " + 
309 		              		
310 		              			"LadderSpeed = " + String.valueOf(getLadderSpeed()
311  	) + " | " + 
312 		              		
313 		              			"AccelRate = " + String.valueOf(getAccelRate()
314  	) + " | " + 
315 		              		
316 		              			"JumpZ = " + String.valueOf(getJumpZ()
317  	) + " | " + 
318 		              		
319 		              			"MultiJumpBoost = " + String.valueOf(getMultiJumpBoost()
320  	) + " | " + 
321 		              		
322 		              			"MaxFallSpeed = " + String.valueOf(getMaxFallSpeed()
323  	) + " | " + 
324 		              		
325 		              			"DodgeSpeedFactor = " + String.valueOf(getDodgeSpeedFactor()
326  	) + " | " + 
327 		              		
328 		              			"DodgeSpeedZ = " + String.valueOf(getDodgeSpeedZ()
329  	) + " | " + 
330 		              		
331 		              			"AirControl = " + String.valueOf(getAirControl()
332  	) + " | " + 
333 		              		
334 				"]";           		
335         }
336  	
337  		
338  		public String toHtmlString() {
339  			return super.toString() + "[<br/>" +
340             	
341 		              			"<b>BotId</b> = " + String.valueOf(getBotId()
342  	) + " <br/> " + 
343 		              		
344 		              			"<b>HealthStart</b> = " + String.valueOf(getHealthStart()
345  	) + " <br/> " + 
346 		              		
347 		              			"<b>HealthFull</b> = " + String.valueOf(getHealthFull()
348  	) + " <br/> " + 
349 		              		
350 		              			"<b>HealthMax</b> = " + String.valueOf(getHealthMax()
351  	) + " <br/> " + 
352 		              		
353 		              			"<b>AdrenalineStart</b> = " + String.valueOf(getAdrenalineStart()
354  	) + " <br/> " + 
355 		              		
356 		              			"<b>AdrenalineMax</b> = " + String.valueOf(getAdrenalineMax()
357  	) + " <br/> " + 
358 		              		
359 		              			"<b>ShieldStrengthStart</b> = " + String.valueOf(getShieldStrengthStart()
360  	) + " <br/> " + 
361 		              		
362 		              			"<b>ShieldStrengthMax</b> = " + String.valueOf(getShieldStrengthMax()
363  	) + " <br/> " + 
364 		              		
365 		              			"<b>MaxMultiJump</b> = " + String.valueOf(getMaxMultiJump()
366  	) + " <br/> " + 
367 		              		
368 		              			"<b>DamageScaling</b> = " + String.valueOf(getDamageScaling()
369  	) + " <br/> " + 
370 		              		
371 		              			"<b>GroundSpeed</b> = " + String.valueOf(getGroundSpeed()
372  	) + " <br/> " + 
373 		              		
374 		              			"<b>WaterSpeed</b> = " + String.valueOf(getWaterSpeed()
375  	) + " <br/> " + 
376 		              		
377 		              			"<b>AirSpeed</b> = " + String.valueOf(getAirSpeed()
378  	) + " <br/> " + 
379 		              		
380 		              			"<b>LadderSpeed</b> = " + String.valueOf(getLadderSpeed()
381  	) + " <br/> " + 
382 		              		
383 		              			"<b>AccelRate</b> = " + String.valueOf(getAccelRate()
384  	) + " <br/> " + 
385 		              		
386 		              			"<b>JumpZ</b> = " + String.valueOf(getJumpZ()
387  	) + " <br/> " + 
388 		              		
389 		              			"<b>MultiJumpBoost</b> = " + String.valueOf(getMultiJumpBoost()
390  	) + " <br/> " + 
391 		              		
392 		              			"<b>MaxFallSpeed</b> = " + String.valueOf(getMaxFallSpeed()
393  	) + " <br/> " + 
394 		              		
395 		              			"<b>DodgeSpeedFactor</b> = " + String.valueOf(getDodgeSpeedFactor()
396  	) + " <br/> " + 
397 		              		
398 		              			"<b>DodgeSpeedZ</b> = " + String.valueOf(getDodgeSpeedZ()
399  	) + " <br/> " + 
400 		              		
401 		              			"<b>AirControl</b> = " + String.valueOf(getAirControl()
402  	) + " <br/> " + 
403 		              		
404 				"<br/>]";     
405 		}
406  	
407  		
408  		// --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=all]) ---
409         	
410 		// --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=all]) ---
411 		
412 	    // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=local+classtype[@name=abstract]) ---
413 	        
414 	    // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=local+classtype[@name=abstract]) ---        	            	
415  	
416 		}
417