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=composite]+classtype[@name=impl] BEGIN
13
14 // --- IMPORTS FROM extra/code/java/javapart/classcategory[@name=composite]+classtype[@name=impl] END
15
16 /**
17 *
18 Composite implementation of the INITED abstract message. It wraps Local/Shared/Static parts in single object
19 allowing to presenting a nice facade for users.
20
21 *
22 * <p></p><p></p>
23 * Complete message documentation:
24 *
25 Asynchronous message. Sent after succesfull init command (so usually just once).
26 Holds many attributes of the bots like speed, id starting and max health, etc.
27 Some attributes are not used due to GameBots mechanics.
28
29 */
30 public class InitedMessageCompositeImpl
31 extends InitedMessage
32 {
33
34
35
36 /**
37 * Parameter-less contructor for the message.
38 */
39 public InitedMessageCompositeImpl()
40 {
41 }
42
43
44 /**
45 * Composite-impl constructor. It assembles the message from its three fragments - local/shared/static.
46 *
47 * @param partLocal local-part of the message
48 * @param partShared shared-part of the message
49 * @param partStatic static-part of the message
50 */
51 public InitedMessageCompositeImpl(
52 InitedMessageLocalImpl partLocal,
53 InitedMessageSharedImpl partShared,
54 InitedMessageStaticImpl partStatic
55 ) {
56 this.partLocal = partLocal;
57 this.partShared = partShared;
58 this.partStatic = partStatic;
59 }
60
61 /**
62 * Cloning constructor.
63 *
64 * @param original
65 */
66 public InitedMessageCompositeImpl(InitedMessageCompositeImpl original) {
67 this.partLocal = partLocal;
68 this.partShared = partShared;
69 this.partStatic = partStatic;
70 }
71
72
73 public UnrealId getId() {
74 return cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.InitedMessage.InitedMessageId;
75 }
76
77
78 @Override
79 public void setSimTime(long SimTime) {
80 super.setSimTime(SimTime);
81 }
82
83
84 protected
85 InitedMessageStaticImpl
86 partStatic;
87
88 @Override
89 public InitedMessageStatic getStatic() {
90 return partStatic;
91 }
92
93 protected
94 InitedMessageLocalImpl
95 partLocal;
96
97 @Override
98 public InitedMessageLocal getLocal() {
99 return partLocal;
100 }
101
102 InitedMessageSharedImpl
103 partShared;
104
105 @Override
106 public InitedMessageShared getShared() {
107 return partShared;
108 }
109
110
111
112 @Override
113
114 /**
115 *
116 A unique unreal Id of the new bot.
117
118 */
119 public UnrealId getBotId()
120 {
121 return
122
123 partLocal.
124 getBotId()
125 ;
126 }
127
128 @Override
129
130 /**
131 *
132 Bot will always start with this health amount (usually 100).
133
134 */
135 public int getHealthStart()
136 {
137 return
138
139 partLocal.
140 getHealthStart()
141 ;
142 }
143
144 @Override
145
146 /**
147 *
148 Full health of the bot (usually 100).
149
150 */
151 public int getHealthFull()
152 {
153 return
154
155 partLocal.
156 getHealthFull()
157 ;
158 }
159
160 @Override
161
162 /**
163 *
164 Maximum health of the bot (default 199).
165
166 */
167 public int getHealthMax()
168 {
169 return
170
171 partLocal.
172 getHealthMax()
173 ;
174 }
175
176 @Override
177
178 /**
179 *
180 Amount of adrenaline at the start. Usually 0.
181
182 */
183 public double getAdrenalineStart()
184 {
185 return
186
187 partLocal.
188 getAdrenalineStart()
189 ;
190 }
191
192 @Override
193
194 /**
195 *
196 Maxium amount of the adrenaline. Usually 100 (this can trigger the combos).
197
198 */
199 public double getAdrenalineMax()
200 {
201 return
202
203 partLocal.
204 getAdrenalineMax()
205 ;
206 }
207
208 @Override
209
210 /**
211 *
212 Starting strength of the bot armor (usually 0).
213
214 */
215 public int getShieldStrengthStart()
216 {
217 return
218
219 partLocal.
220 getShieldStrengthStart()
221 ;
222 }
223
224 @Override
225
226 /**
227 *
228 Maximum strength of the bot armor (usually 150).
229
230 */
231 public int getShieldStrengthMax()
232 {
233 return
234
235 partLocal.
236 getShieldStrengthMax()
237 ;
238 }
239
240 @Override
241
242 /**
243 *
244 Maximum amount of succesing jumps. Currently limited to double jump in GB.
245
246 */
247 public int getMaxMultiJump()
248 {
249 return
250
251 partLocal.
252 getMaxMultiJump()
253 ;
254 }
255
256 @Override
257
258 /**
259 *
260 Damage scaling for this bot. (he will deal reduced damage depending on the setting).
261
262 */
263 public double getDamageScaling()
264 {
265 return
266
267 partLocal.
268 getDamageScaling()
269 ;
270 }
271
272 @Override
273
274 /**
275 *
276 Groundspeed of the bot (on the ground). Default 440.
277
278 */
279 public double getGroundSpeed()
280 {
281 return
282
283 partLocal.
284 getGroundSpeed()
285 ;
286 }
287
288 @Override
289
290 /**
291 *
292 Waterspeed of the bot (in the water).
293
294 */
295 public double getWaterSpeed()
296 {
297 return
298
299 partLocal.
300 getWaterSpeed()
301 ;
302 }
303
304 @Override
305
306 /**
307 *
308 AirSpeed of the bot (in the air).
309
310 */
311 public double getAirSpeed()
312 {
313 return
314
315 partLocal.
316 getAirSpeed()
317 ;
318 }
319
320 @Override
321
322 /**
323 *
324 Ladderspeed of the bot (on the ladder).
325
326 */
327 public double getLadderSpeed()
328 {
329 return
330
331 partLocal.
332 getLadderSpeed()
333 ;
334 }
335
336 @Override
337
338 /**
339 *
340 Accelartion rate of this bot. How fast he accelerates.
341
342 */
343 public double getAccelRate()
344 {
345 return
346
347 partLocal.
348 getAccelRate()
349 ;
350 }
351
352 @Override
353
354 /**
355 *
356 Bot Jump's Z boost.
357
358 */
359 public double getJumpZ()
360 {
361 return
362
363 partLocal.
364 getJumpZ()
365 ;
366 }
367
368 @Override
369
370 /**
371 *
372 Not used in GB.
373
374 */
375 public double getMultiJumpBoost()
376 {
377 return
378
379 partLocal.
380 getMultiJumpBoost()
381 ;
382 }
383
384 @Override
385
386 /**
387 *
388 Max fall speed of the bot.
389
390 */
391 public double getMaxFallSpeed()
392 {
393 return
394
395 partLocal.
396 getMaxFallSpeed()
397 ;
398 }
399
400 @Override
401
402 /**
403 *
404 Dodge speed factor.
405
406 */
407 public double getDodgeSpeedFactor()
408 {
409 return
410
411 partLocal.
412 getDodgeSpeedFactor()
413 ;
414 }
415
416 @Override
417
418 /**
419 *
420 Dodge jump Z boost of the bot.
421
422 */
423 public double getDodgeSpeedZ()
424 {
425 return
426
427 partLocal.
428 getDodgeSpeedZ()
429 ;
430 }
431
432 @Override
433
434 /**
435 *
436 How well can be the bot controlled in the air (ranges from 0 to 1).
437
438 */
439 public double getAirControl()
440 {
441 return
442
443 partLocal.
444 getAirControl()
445 ;
446 }
447
448
449 public String toString() {
450 return
451 super.toString() + "[" +
452
453 "Static = " + String.valueOf(partStatic) + " | Local = " + String.valueOf(partLocal) + " | Shared = " + String.valueOf(partShared) + " ]" +
454
455 "]";
456 }
457
458
459 public String toHtmlString() {
460 return super.toString() + "[<br/>" +
461
462 "Static = " + String.valueOf(partStatic) + " <br/> Local = " + String.valueOf(partLocal) + " <br/> Shared = " + String.valueOf(partShared) + " ]" +
463
464 "<br/>]";
465 }
466
467
468 // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=all]) ---
469
470 // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=all]) ---
471
472 // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=composite+classtype[@name=impl]) ---
473
474 // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=composite+classtype[@name=impl]) ---
475
476 }
477