1
2 /**
3 IMPORTANT !!!
4
5 DO NOT EDIT THIS FILE. IT IS GENERATED FROM approriate xml file in xmlresources/gbcommands BY
6 THE JavaClassesGenerator.xslt. MODIFY THESE FILES INSTEAD OF THIS ONE.
7
8 IMPORTANT END !!!
9 */
10 package
11 cz.cuni.amis.pogamut.udk.communication.messages.gbcommands;
12 import java.util.*;
13 import javax.vecmath.*;
14 import cz.cuni.amis.pogamut.base.communication.messages.*;
15 import cz.cuni.amis.pogamut.base.communication.worldview.*;
16 import cz.cuni.amis.pogamut.base.communication.worldview.event.*;
17 import cz.cuni.amis.pogamut.base.communication.worldview.object.*;
18 import cz.cuni.amis.pogamut.base.communication.translator.event.*;
19 import cz.cuni.amis.pogamut.base3d.worldview.object.*;
20 import cz.cuni.amis.pogamut.base3d.worldview.object.event.*;
21 import cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId;
22 import cz.cuni.amis.pogamut.udk.communication.messages.*;
23 import cz.cuni.amis.pogamut.udk.communication.worldview.objects.*;
24 import cz.cuni.amis.pogamut.udk.communication.translator.itemdescriptor.*;
25 import cz.cuni.amis.pogamut.udk.communication.messages.ItemType.Category;
26 import cz.cuni.amis.utils.exception.*;
27 import cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result;
28 import cz.cuni.amis.utils.SafeEquals;
29 import cz.cuni.amis.pogamut.multi.communication.worldview.object.*;
30
31
32 /**
33
34 Message you'll send at the beginning of the communication to
35 create a bot in the game. You must send this message before you
36 can have a character to play in the game.
37
38 Corresponding GameBots command is
39 INIT.
40
41 */
42
43 public class
44 Initialize extends
45 CommandMessage
46
47 {
48
49 /**
50 Creates new instance of command Initialize.
51
52 Message you'll send at the beginning of the communication to
53 create a bot in the game. You must send this message before you
54 can have a character to play in the game.
55 Corresponding GameBots message for this command is
56 INIT.
57 @param Name Desired name.
58 @param Team
59 Preferred team. If illegal or no team provided, one will be
60 provided for you. Normally a team game has team 0 and team
61 1. In BotDeathMatch, team is meaningless.
62
63 @param ManualSpawn
64 Sets if the bot wil have tol be respawned after death
65 manually by RESPAWN command. If false, the bot will respawn
66 automatically.
67
68 @param AutoTrace
69 Enables/disables auto ray tracing feature.
70
71 @param Location
72 Specify start location, if unspecified, then random.
73
74 @param Rotation
75 Specify start rotation, if unspecified, then random.
76
77 @param Skin
78 Sets the bot current skin using UTFamilyInfo (e.g. "UTGame.UTFamilyInfo_Liandri_Male").
79 // TODO: we might want to export all possible skins at the beginning of the game
80
81 @param DesiredSkill
82 Can range from 0 to 7. This sets the bot accuracy. 1 lowest,
83 7 highest. Shouldn't have any other effect.
84
85 @param ShouldLeadTarget
86 When firing slow projectiles (missiles...), if the engine
87 will try to count the impact point for the bot or not (when
88 shooting at moving targets).
89
90 @param AutoPickupOff
91 It enables/disables automatic pickup of the bot. If true the items can be picked up through PICK command.
92
93 @param Jmx
94 Sets the jmx adress we can use to debug the bot from Java (if we are using Pogamut).
95
96 @param ClassName
97 TODO Michal, whats this?
98
99 */
100 public Initialize(
101 String Name, int Team, boolean ManualSpawn, boolean AutoTrace, Location Location, Rotation Rotation, String Skin, int DesiredSkill, boolean ShouldLeadTarget, boolean AutoPickupOff, String Jmx, String ClassName) {
102
103 this.Name = Name;
104
105 this.Team = Team;
106
107 this.ManualSpawn = ManualSpawn;
108
109 this.AutoTrace = AutoTrace;
110
111 this.Location = Location;
112
113 this.Rotation = Rotation;
114
115 this.Skin = Skin;
116
117 this.DesiredSkill = DesiredSkill;
118
119 this.ShouldLeadTarget = ShouldLeadTarget;
120
121 this.AutoPickupOff = AutoPickupOff;
122
123 this.Jmx = Jmx;
124
125 this.ClassName = ClassName;
126
127 }
128
129
130 /**
131 Creates new instance of command Initialize.
132
133 Message you'll send at the beginning of the communication to
134 create a bot in the game. You must send this message before you
135 can have a character to play in the game.
136 Corresponding GameBots message for this command is
137 INIT.
138 <p></p>WARNING: this is empty-command constructor, you have to use setters to fill it up!
139 */
140 public Initialize() {
141 }
142
143
144 /////// Properties BEGIN
145
146 /**
147 Desired name. */
148 protected
149 String Name =
150 null;
151
152
153 /**
154 Desired name. */
155 public
156 String getName() {
157 return
158 Name;
159 }
160
161
162
163 /**
164 Desired name. */
165 public Initialize setName(String Name) {
166 this.Name = Name;
167 return this;
168 }
169
170 /**
171
172 Preferred team. If illegal or no team provided, one will be
173 provided for you. Normally a team game has team 0 and team
174 1. In BotDeathMatch, team is meaningless.
175 */
176 protected
177 int Team =
178 0;
179
180
181 /**
182
183 Preferred team. If illegal or no team provided, one will be
184 provided for you. Normally a team game has team 0 and team
185 1. In BotDeathMatch, team is meaningless.
186 */
187 public
188 int getTeam() {
189 return
190 Team;
191 }
192
193
194
195 /**
196
197 Preferred team. If illegal or no team provided, one will be
198 provided for you. Normally a team game has team 0 and team
199 1. In BotDeathMatch, team is meaningless.
200 */
201 public Initialize setTeam(int Team) {
202 this.Team = Team;
203 return this;
204 }
205
206 /**
207
208 Sets if the bot wil have tol be respawned after death
209 manually by RESPAWN command. If false, the bot will respawn
210 automatically.
211 */
212 protected
213 boolean ManualSpawn =
214 false;
215
216
217 /**
218
219 Sets if the bot wil have tol be respawned after death
220 manually by RESPAWN command. If false, the bot will respawn
221 automatically.
222 */
223 public
224 boolean isManualSpawn() {
225 return
226 ManualSpawn;
227 }
228
229
230
231 /**
232
233 Sets if the bot wil have tol be respawned after death
234 manually by RESPAWN command. If false, the bot will respawn
235 automatically.
236 */
237 public Initialize setManualSpawn(boolean ManualSpawn) {
238 this.ManualSpawn = ManualSpawn;
239 return this;
240 }
241
242 /**
243
244 Enables/disables auto ray tracing feature.
245 */
246 protected
247 boolean AutoTrace =
248 false;
249
250
251 /**
252
253 Enables/disables auto ray tracing feature.
254 */
255 public
256 boolean isAutoTrace() {
257 return
258 AutoTrace;
259 }
260
261
262
263 /**
264
265 Enables/disables auto ray tracing feature.
266 */
267 public Initialize setAutoTrace(boolean AutoTrace) {
268 this.AutoTrace = AutoTrace;
269 return this;
270 }
271
272 /**
273
274 Specify start location, if unspecified, then random.
275 */
276 protected
277 Location Location =
278 null;
279
280
281 /**
282
283 Specify start location, if unspecified, then random.
284 */
285 public
286 Location getLocation() {
287 return
288 Location;
289 }
290
291
292
293 /**
294
295 Specify start location, if unspecified, then random.
296 */
297 public Initialize setLocation(Location Location) {
298 this.Location = Location;
299 return this;
300 }
301
302 /**
303
304 Specify start rotation, if unspecified, then random.
305 */
306 protected
307 Rotation Rotation =
308 null;
309
310
311 /**
312
313 Specify start rotation, if unspecified, then random.
314 */
315 public
316 Rotation getRotation() {
317 return
318 Rotation;
319 }
320
321
322
323 /**
324
325 Specify start rotation, if unspecified, then random.
326 */
327 public Initialize setRotation(Rotation Rotation) {
328 this.Rotation = Rotation;
329 return this;
330 }
331
332 /**
333
334 Sets the bot current skin using UTFamilyInfo (e.g. "UTGame.UTFamilyInfo_Liandri_Male").
335 // TODO: we might want to export all possible skins at the beginning of the game
336 */
337 protected
338 String Skin =
339 null;
340
341
342 /**
343
344 Sets the bot current skin using UTFamilyInfo (e.g. "UTGame.UTFamilyInfo_Liandri_Male").
345 // TODO: we might want to export all possible skins at the beginning of the game
346 */
347 public
348 String getSkin() {
349 return
350 Skin;
351 }
352
353
354
355 /**
356
357 Sets the bot current skin using UTFamilyInfo (e.g. "UTGame.UTFamilyInfo_Liandri_Male").
358 // TODO: we might want to export all possible skins at the beginning of the game
359 */
360 public Initialize setSkin(String Skin) {
361 this.Skin = Skin;
362 return this;
363 }
364
365 /**
366
367 Can range from 0 to 7. This sets the bot accuracy. 1 lowest,
368 7 highest. Shouldn't have any other effect.
369 */
370 protected
371 int DesiredSkill =
372 0;
373
374
375 /**
376
377 Can range from 0 to 7. This sets the bot accuracy. 1 lowest,
378 7 highest. Shouldn't have any other effect.
379 */
380 public
381 int getDesiredSkill() {
382 return
383 DesiredSkill;
384 }
385
386
387
388 /**
389
390 Can range from 0 to 7. This sets the bot accuracy. 1 lowest,
391 7 highest. Shouldn't have any other effect.
392 */
393 public Initialize setDesiredSkill(int DesiredSkill) {
394 this.DesiredSkill = DesiredSkill;
395 return this;
396 }
397
398 /**
399
400 When firing slow projectiles (missiles...), if the engine
401 will try to count the impact point for the bot or not (when
402 shooting at moving targets).
403 */
404 protected
405 boolean ShouldLeadTarget =
406 false;
407
408
409 /**
410
411 When firing slow projectiles (missiles...), if the engine
412 will try to count the impact point for the bot or not (when
413 shooting at moving targets).
414 */
415 public
416 boolean isShouldLeadTarget() {
417 return
418 ShouldLeadTarget;
419 }
420
421
422
423 /**
424
425 When firing slow projectiles (missiles...), if the engine
426 will try to count the impact point for the bot or not (when
427 shooting at moving targets).
428 */
429 public Initialize setShouldLeadTarget(boolean ShouldLeadTarget) {
430 this.ShouldLeadTarget = ShouldLeadTarget;
431 return this;
432 }
433
434 /**
435
436 It enables/disables automatic pickup of the bot. If true the items can be picked up through PICK command.
437 */
438 protected
439 boolean AutoPickupOff =
440 false;
441
442
443 /**
444
445 It enables/disables automatic pickup of the bot. If true the items can be picked up through PICK command.
446 */
447 public
448 boolean isAutoPickupOff() {
449 return
450 AutoPickupOff;
451 }
452
453
454
455 /**
456
457 It enables/disables automatic pickup of the bot. If true the items can be picked up through PICK command.
458 */
459 public Initialize setAutoPickupOff(boolean AutoPickupOff) {
460 this.AutoPickupOff = AutoPickupOff;
461 return this;
462 }
463
464 /**
465
466 Sets the jmx adress we can use to debug the bot from Java (if we are using Pogamut).
467 */
468 protected
469 String Jmx =
470 null;
471
472
473 /**
474
475 Sets the jmx adress we can use to debug the bot from Java (if we are using Pogamut).
476 */
477 public
478 String getJmx() {
479 return
480 Jmx;
481 }
482
483
484
485 /**
486
487 Sets the jmx adress we can use to debug the bot from Java (if we are using Pogamut).
488 */
489 public Initialize setJmx(String Jmx) {
490 this.Jmx = Jmx;
491 return this;
492 }
493
494 /**
495
496 TODO Michal, whats this?
497 */
498 protected
499 String ClassName =
500 null;
501
502
503 /**
504
505 TODO Michal, whats this?
506 */
507 public
508 String getClassName() {
509 return
510 ClassName;
511 }
512
513
514
515 /**
516
517 TODO Michal, whats this?
518 */
519 public Initialize setClassName(String ClassName) {
520 this.ClassName = ClassName;
521 return this;
522 }
523
524 /////// Properties END
525
526 /////// Extra Java code BEGIN
527
528 /////// Additional code from xslt BEGIN
529
530
531
532 /////// Additional code from xslt END
533
534 /////// Extra Java from XML BEGIN
535
536 /////// Extra Java from XML END
537
538 /////// Extra Java code END
539
540
541
542 /**
543 * Cloning constructor.
544 */
545 public Initialize(Initialize original) {
546
547 this.Name=original.Name;
548
549 this.Team=original.Team;
550
551 this.ManualSpawn=original.ManualSpawn;
552
553 this.AutoTrace=original.AutoTrace;
554
555 this.Location=original.Location;
556
557 this.Rotation=original.Rotation;
558
559 this.Skin=original.Skin;
560
561 this.DesiredSkill=original.DesiredSkill;
562
563 this.ShouldLeadTarget=original.ShouldLeadTarget;
564
565 this.AutoPickupOff=original.AutoPickupOff;
566
567 this.Jmx=original.Jmx;
568
569 this.ClassName=original.ClassName;
570
571 }
572
573
574
575
576 public String toString() {
577 return
578
579 toMessage();
580
581 }
582
583 public String toHtmlString() {
584 return super.toString() +
585
586 "<b>Name</b> : " +
587 String.valueOf(Name) +
588 " <br/> " +
589
590 "<b>Team</b> : " +
591 String.valueOf(Team) +
592 " <br/> " +
593
594 "<b>ManualSpawn</b> : " +
595 String.valueOf(ManualSpawn) +
596 " <br/> " +
597
598 "<b>AutoTrace</b> : " +
599 String.valueOf(AutoTrace) +
600 " <br/> " +
601
602 "<b>Location</b> : " +
603 String.valueOf(Location) +
604 " <br/> " +
605
606 "<b>Rotation</b> : " +
607 String.valueOf(Rotation) +
608 " <br/> " +
609
610 "<b>Skin</b> : " +
611 String.valueOf(Skin) +
612 " <br/> " +
613
614 "<b>DesiredSkill</b> : " +
615 String.valueOf(DesiredSkill) +
616 " <br/> " +
617
618 "<b>ShouldLeadTarget</b> : " +
619 String.valueOf(ShouldLeadTarget) +
620 " <br/> " +
621
622 "<b>AutoPickupOff</b> : " +
623 String.valueOf(AutoPickupOff) +
624 " <br/> " +
625
626 "<b>Jmx</b> : " +
627 String.valueOf(Jmx) +
628 " <br/> " +
629
630 "<b>ClassName</b> : " +
631 String.valueOf(ClassName) +
632 " <br/> " +
633 "";
634 }
635
636
637
638 public String toMessage() {
639 StringBuffer buf = new StringBuffer();
640 buf.append("INIT");
641
642 if (Name != null) {
643 buf.append(" {Name " + Name + "}");
644 }
645
646 buf.append(" {Team " + Team + "}");
647
648 buf.append(" {ManualSpawn " + ManualSpawn + "}");
649
650 buf.append(" {AutoTrace " + AutoTrace + "}");
651
652 if (Location != null) {
653 buf.append(" {Location " +
654 Location.getX() + "," +
655 Location.getY() + "," +
656 Location.getZ() + "}");
657 }
658
659 if (Rotation != null) {
660 buf.append(" {Rotation " +
661 Rotation.getPitch() + "," +
662 Rotation.getYaw() + "," +
663 Rotation.getRoll() + "}");
664 }
665
666 if (Skin != null) {
667 buf.append(" {Skin " + Skin + "}");
668 }
669
670 buf.append(" {DesiredSkill " + DesiredSkill + "}");
671
672 buf.append(" {ShouldLeadTarget " + ShouldLeadTarget + "}");
673
674 buf.append(" {AutoPickupOff " + AutoPickupOff + "}");
675
676 if (Jmx != null) {
677 buf.append(" {Jmx " + Jmx + "}");
678 }
679
680 if (ClassName != null) {
681 buf.append(" {ClassName " + ClassName + "}");
682 }
683
684 return buf.toString();
685 }
686
687 }
688
689