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=base]+classtype[@name=message] BEGIN
13
14 // --- IMPORTS FROM extra/code/java/javapart/classcategory[@name=base]+classtype[@name=message] END
15
16 /**
17 *
18 Implementation of the GameBots2004 message SLF contains also its Local/Shared/Static subpart class definitions..
19
20 *
21 * <p></p><p></p>
22 * Complete message documentation:
23 *
24 Synchronous message. Information about your bot's state.
25
26 */
27 public class SelfMessage
28 extends
29 Self
30 implements IWorldObjectUpdatedEvent, ICompositeWorldObjectUpdatedEvent
31
32 {
33
34
35
36 /**
37 * Parameter-less contructor for the message.
38 */
39 public SelfMessage()
40 {
41 }
42
43
44
45
46 /**
47 * Creates new instance of the message Self.
48 *
49 Synchronous message. Information about your bot's state.
50
51 * Corresponding GameBots message
52 *
53 * is
54 * SLF.
55 *
56 *
57 *
58 * @param Id Unique Id of this self message instance.
59 *
60 *
61 *
62 * @param BotId Unique Id of this bot.
63 *
64 *
65 *
66 * @param Name Human readable bot name.
67 *
68 *
69 *
70 * @param Vehicle If we are vehicle just these attr. are sent in SLF: "Id","Vehicle""Rotation", "Location","Velocity ","Name ","Team" ,"Health"
71 "Armor","Adrenaline", "FloorLocation", "FloorNormal".
72 *
73 *
74 *
75 * @param Location
76 An absolute location of the bot.
77
78 *
79 *
80 *
81 * @param Velocity
82 Absolute velocity of the bot as a vector of movement per one
83 game second.
84
85 *
86 *
87 *
88 * @param Rotation
89 Which direction the bot is facing in absolute terms.
90
91 *
92 *
93 *
94 * @param Team
95 What team the bot is on. 255 is no team. 0-3 are red,
96 blue, green, gold in that order.
97
98 *
99 *
100 *
101 * @param Weapon
102 Id of the weapon we are holding. This is unique Id of an
103 item in our inventory and is different from the Id of the
104 item we pick up from the ground! We can parse this string to
105 look which weapon we hold. Weapon strings to look for
106 include: "AssaultRifle", "ShieldGun", "FlakCannon",
107 "BioRifle", "ShockRifle", "LinkGun", "SniperRifle",
108 "RocketLauncher", "Minigun", "LightingGun", "Translocator".
109 TODO: Look if this is all.
110
111 *
112 *
113 *
114 * @param Shooting If the bot is shooting or not.
115 *
116 *
117 *
118 * @param Health
119 How much health the bot has left. Starts at 100, ranges from
120 0 to 200.
121
122 *
123 *
124 *
125 * @param PrimaryAmmo
126 How much ammo the bot has left for current weapon primary
127 mode.
128
129 *
130 *
131 *
132 * @param SecondaryAmmo
133 How much ammo the bot has left for current weapon secondary
134 mode. Weapon does not have to support sec. fire mode.
135
136 *
137 *
138 *
139 * @param Adrenaline How much adrenaline the bot has.
140 *
141 *
142 *
143 * @param Armor
144 Combined size of high armor and low armor (or small armor). The high and low armor are tracked
145 separately. Low armor is limited to 50 points, while the
146 high armor can have up to 150 points. Both stacks can have a combined size of 150 points as well,
147 so if low armor is already at 50 points, high armor can have
148 100 points at max.
149
150 *
151 *
152 *
153 * @param SmallArmor
154 Also refered to as a "low armor". Ranges from 0 to 50 points.
155
156 *
157 *
158 *
159 * @param AltFiring
160 If we are firing in secondary firing mode.
161
162 *
163 *
164 *
165 * @param Crouched
166 If we are currently crouched.
167
168 *
169 *
170 *
171 * @param Walking
172 If we are currently in walking mode.
173
174 *
175 *
176 *
177 * @param FloorLocation
178 Holds current floor location under the bot.
179
180 *
181 *
182 *
183 * @param FloorNormal
184 Holds current floor normal under the bot.
185
186 *
187 *
188 *
189 * @param Combo
190 Name of the current combo (None if no combo active).
191 Can be xGame.ComboBerserk, xGame.ComboDefensive, xGame.ComboInvis or xGame.ComboSpeed.
192 To trigger combo adrenaline needs to be at 100 (maximum) and no other combo can be active.
193
194 *
195 *
196 *
197 * @param UDamageTime
198 Time when the UDamage effect expires. If the number is higher then the current
199 time, it means the bot has UDamage effect active right now.
200
201 *
202 *
203 *
204 * @param Action
205 Name of the current BDI action.
206
207 *
208 *
209 *
210 * @param EmotLeft
211 For UE2. Holds left emoticon of the bot, "None" means none set.
212
213 *
214 *
215 *
216 * @param EmotCenter
217 For UE2. Holds center emoticon of the bot, "None" means none set.
218
219 *
220 *
221 *
222 * @param EmotRight
223 For UE2. Holds right emoticon of the bot, "None" means none set.
224
225 *
226 *
227 *
228 * @param Bubble
229 For UE2. Holds the bubble of the emoticon of the bot, "None" means none set.
230
231 *
232 *
233 *
234 * @param Anim
235 For UE2. Current played animation of the bot.
236
237 *
238 *
239 */
240 public SelfMessage(
241 UnrealId Id, UnrealId BotId, String Name, boolean Vehicle, Location Location, Velocity Velocity, Rotation Rotation, int Team, String Weapon, boolean Shooting, int Health, int PrimaryAmmo, int SecondaryAmmo, int Adrenaline, int Armor, int SmallArmor, boolean AltFiring, boolean Crouched, boolean Walking, Location FloorLocation, Location FloorNormal, String Combo, double UDamageTime, String Action, String EmotLeft, String EmotCenter, String EmotRight, String Bubble, String Anim
242 ) {
243
244 this.Id = Id;
245
246 this.BotId = BotId;
247
248 this.Name = Name;
249
250 this.Vehicle = Vehicle;
251
252 this.Location = Location;
253
254 this.Velocity = Velocity;
255
256 this.Rotation = Rotation;
257
258 this.Team = Team;
259
260 this.Weapon = Weapon;
261
262 this.Shooting = Shooting;
263
264 this.Health = Health;
265
266 this.PrimaryAmmo = PrimaryAmmo;
267
268 this.SecondaryAmmo = SecondaryAmmo;
269
270 this.Adrenaline = Adrenaline;
271
272 this.Armor = Armor;
273
274 this.SmallArmor = SmallArmor;
275
276 this.AltFiring = AltFiring;
277
278 this.Crouched = Crouched;
279
280 this.Walking = Walking;
281
282 this.FloorLocation = FloorLocation;
283
284 this.FloorNormal = FloorNormal;
285
286 this.Combo = Combo;
287
288 this.UDamageTime = UDamageTime;
289
290 this.Action = Action;
291
292 this.EmotLeft = EmotLeft;
293
294 this.EmotCenter = EmotCenter;
295
296 this.EmotRight = EmotRight;
297
298 this.Bubble = Bubble;
299
300 this.Anim = Anim;
301
302 }
303
304 /**
305 * Cloning constructor from the full message.
306 *
307 * @param original
308 */
309 public SelfMessage(SelfMessage original) {
310
311 this.Id = original.getId()
312 ;
313
314 this.BotId = original.getBotId()
315 ;
316
317 this.Name = original.getName()
318 ;
319
320 this.Vehicle = original.isVehicle()
321 ;
322
323 this.Location = original.getLocation()
324 ;
325
326 this.Velocity = original.getVelocity()
327 ;
328
329 this.Rotation = original.getRotation()
330 ;
331
332 this.Team = original.getTeam()
333 ;
334
335 this.Weapon = original.getWeapon()
336 ;
337
338 this.Shooting = original.isShooting()
339 ;
340
341 this.Health = original.getHealth()
342 ;
343
344 this.PrimaryAmmo = original.getPrimaryAmmo()
345 ;
346
347 this.SecondaryAmmo = original.getSecondaryAmmo()
348 ;
349
350 this.Adrenaline = original.getAdrenaline()
351 ;
352
353 this.Armor = original.getArmor()
354 ;
355
356 this.SmallArmor = original.getSmallArmor()
357 ;
358
359 this.AltFiring = original.isAltFiring()
360 ;
361
362 this.Crouched = original.isCrouched()
363 ;
364
365 this.Walking = original.isWalking()
366 ;
367
368 this.FloorLocation = original.getFloorLocation()
369 ;
370
371 this.FloorNormal = original.getFloorNormal()
372 ;
373
374 this.Combo = original.getCombo()
375 ;
376
377 this.UDamageTime = original.getUDamageTime()
378 ;
379
380 this.Action = original.getAction()
381 ;
382
383 this.EmotLeft = original.getEmotLeft()
384 ;
385
386 this.EmotCenter = original.getEmotCenter()
387 ;
388
389 this.EmotRight = original.getEmotRight()
390 ;
391
392 this.Bubble = original.getBubble()
393 ;
394
395 this.Anim = original.getAnim()
396 ;
397
398 this.TeamId = original.getTeamId();
399
400 this.SimTime = original.getSimTime();
401 }
402
403
404 protected ITeamId TeamId;
405
406 /**
407 * Used by Yylex to slip corretn TeamId.
408 */
409 protected void setTeamId(ITeamId TeamId) {
410 this.TeamId = TeamId;
411 }
412
413 public ITeamId getTeamId() {
414 return TeamId;
415 }
416
417
418
419
420 /**
421 * Unique Id of this self message instance.
422 */
423 protected
424 UnrealId Id =
425 null;
426
427
428 /**
429 * Whether property 'Id' was received from GB2004.
430 */
431 protected boolean Id_Set = false;
432
433 @Override
434
435 /**
436 * Unique Id of this self message instance.
437 */
438 public UnrealId getId()
439 {
440 return Id;
441 }
442
443
444 /**
445 * Unique Id of this bot.
446 */
447 protected
448 UnrealId BotId =
449 null;
450
451
452 /**
453 * Whether property 'BotId' was received from GB2004.
454 */
455 protected boolean BotId_Set = false;
456
457 @Override
458
459 /**
460 * Unique Id of this bot.
461 */
462 public UnrealId getBotId()
463 {
464 return BotId;
465 }
466
467
468 /**
469 * Human readable bot name.
470 */
471 protected
472 String Name =
473 null;
474
475
476 /**
477 * Whether property 'Name' was received from GB2004.
478 */
479 protected boolean Name_Set = false;
480
481 @Override
482
483 /**
484 * Human readable bot name.
485 */
486 public String getName()
487 {
488 return Name;
489 }
490
491
492 /**
493 * If we are vehicle just these attr. are sent in SLF: "Id","Vehicle""Rotation", "Location","Velocity ","Name ","Team" ,"Health"
494 "Armor","Adrenaline", "FloorLocation", "FloorNormal".
495 */
496 protected
497 boolean Vehicle =
498 false;
499
500
501 /**
502 * Whether property 'Vehicle' was received from GB2004.
503 */
504 protected boolean Vehicle_Set = false;
505
506 @Override
507
508 /**
509 * If we are vehicle just these attr. are sent in SLF: "Id","Vehicle""Rotation", "Location","Velocity ","Name ","Team" ,"Health"
510 "Armor","Adrenaline", "FloorLocation", "FloorNormal".
511 */
512 public boolean isVehicle()
513 {
514 return Vehicle;
515 }
516
517
518 /**
519 *
520 An absolute location of the bot.
521
522 */
523 protected
524 Location Location =
525 null;
526
527
528 /**
529 * Whether property 'Location' was received from GB2004.
530 */
531 protected boolean Location_Set = false;
532
533 @Override
534
535 /**
536 *
537 An absolute location of the bot.
538
539 */
540 public Location getLocation()
541 {
542 return Location;
543 }
544
545
546 /**
547 *
548 Absolute velocity of the bot as a vector of movement per one
549 game second.
550
551 */
552 protected
553 Velocity Velocity =
554 null;
555
556
557 /**
558 * Whether property 'Velocity' was received from GB2004.
559 */
560 protected boolean Velocity_Set = false;
561
562 @Override
563
564 /**
565 *
566 Absolute velocity of the bot as a vector of movement per one
567 game second.
568
569 */
570 public Velocity getVelocity()
571 {
572 return Velocity;
573 }
574
575
576 /**
577 *
578 Which direction the bot is facing in absolute terms.
579
580 */
581 protected
582 Rotation Rotation =
583 null;
584
585
586 /**
587 * Whether property 'Rotation' was received from GB2004.
588 */
589 protected boolean Rotation_Set = false;
590
591 @Override
592
593 /**
594 *
595 Which direction the bot is facing in absolute terms.
596
597 */
598 public Rotation getRotation()
599 {
600 return Rotation;
601 }
602
603
604 /**
605 *
606 What team the bot is on. 255 is no team. 0-3 are red,
607 blue, green, gold in that order.
608
609 */
610 protected
611 int Team =
612 0;
613
614
615 /**
616 * Whether property 'Team' was received from GB2004.
617 */
618 protected boolean Team_Set = false;
619
620 @Override
621
622 /**
623 *
624 What team the bot is on. 255 is no team. 0-3 are red,
625 blue, green, gold in that order.
626
627 */
628 public int getTeam()
629 {
630 return Team;
631 }
632
633
634 /**
635 *
636 Id of the weapon we are holding. This is unique Id of an
637 item in our inventory and is different from the Id of the
638 item we pick up from the ground! We can parse this string to
639 look which weapon we hold. Weapon strings to look for
640 include: "AssaultRifle", "ShieldGun", "FlakCannon",
641 "BioRifle", "ShockRifle", "LinkGun", "SniperRifle",
642 "RocketLauncher", "Minigun", "LightingGun", "Translocator".
643 TODO: Look if this is all.
644
645 */
646 protected
647 String Weapon =
648 null;
649
650
651 /**
652 * Whether property 'Weapon' was received from GB2004.
653 */
654 protected boolean Weapon_Set = false;
655
656 @Override
657
658 /**
659 *
660 Id of the weapon we are holding. This is unique Id of an
661 item in our inventory and is different from the Id of the
662 item we pick up from the ground! We can parse this string to
663 look which weapon we hold. Weapon strings to look for
664 include: "AssaultRifle", "ShieldGun", "FlakCannon",
665 "BioRifle", "ShockRifle", "LinkGun", "SniperRifle",
666 "RocketLauncher", "Minigun", "LightingGun", "Translocator".
667 TODO: Look if this is all.
668
669 */
670 public String getWeapon()
671 {
672 return Weapon;
673 }
674
675
676 /**
677 * If the bot is shooting or not.
678 */
679 protected
680 boolean Shooting =
681 false;
682
683
684 /**
685 * Whether property 'Shooting' was received from GB2004.
686 */
687 protected boolean Shooting_Set = false;
688
689 @Override
690
691 /**
692 * If the bot is shooting or not.
693 */
694 public boolean isShooting()
695 {
696 return Shooting;
697 }
698
699
700 /**
701 *
702 How much health the bot has left. Starts at 100, ranges from
703 0 to 200.
704
705 */
706 protected
707 int Health =
708 0;
709
710
711 /**
712 * Whether property 'Health' was received from GB2004.
713 */
714 protected boolean Health_Set = false;
715
716 @Override
717
718 /**
719 *
720 How much health the bot has left. Starts at 100, ranges from
721 0 to 200.
722
723 */
724 public int getHealth()
725 {
726 return Health;
727 }
728
729
730 /**
731 *
732 How much ammo the bot has left for current weapon primary
733 mode.
734
735 */
736 protected
737 int PrimaryAmmo =
738 0;
739
740
741 /**
742 * Whether property 'PrimaryAmmo' was received from GB2004.
743 */
744 protected boolean PrimaryAmmo_Set = false;
745
746 @Override
747
748 /**
749 *
750 How much ammo the bot has left for current weapon primary
751 mode.
752
753 */
754 public int getPrimaryAmmo()
755 {
756 return PrimaryAmmo;
757 }
758
759
760 /**
761 *
762 How much ammo the bot has left for current weapon secondary
763 mode. Weapon does not have to support sec. fire mode.
764
765 */
766 protected
767 int SecondaryAmmo =
768 0;
769
770
771 /**
772 * Whether property 'SecondaryAmmo' was received from GB2004.
773 */
774 protected boolean SecondaryAmmo_Set = false;
775
776 @Override
777
778 /**
779 *
780 How much ammo the bot has left for current weapon secondary
781 mode. Weapon does not have to support sec. fire mode.
782
783 */
784 public int getSecondaryAmmo()
785 {
786 return SecondaryAmmo;
787 }
788
789
790 /**
791 * How much adrenaline the bot has.
792 */
793 protected
794 int Adrenaline =
795 0;
796
797
798 /**
799 * Whether property 'Adrenaline' was received from GB2004.
800 */
801 protected boolean Adrenaline_Set = false;
802
803 @Override
804
805 /**
806 * How much adrenaline the bot has.
807 */
808 public int getAdrenaline()
809 {
810 return Adrenaline;
811 }
812
813
814 /**
815 *
816 Combined size of high armor and low armor (or small armor). The high and low armor are tracked
817 separately. Low armor is limited to 50 points, while the
818 high armor can have up to 150 points. Both stacks can have a combined size of 150 points as well,
819 so if low armor is already at 50 points, high armor can have
820 100 points at max.
821
822 */
823 protected
824 int Armor =
825 0;
826
827
828 /**
829 * Whether property 'Armor' was received from GB2004.
830 */
831 protected boolean Armor_Set = false;
832
833 @Override
834
835 /**
836 *
837 Combined size of high armor and low armor (or small armor). The high and low armor are tracked
838 separately. Low armor is limited to 50 points, while the
839 high armor can have up to 150 points. Both stacks can have a combined size of 150 points as well,
840 so if low armor is already at 50 points, high armor can have
841 100 points at max.
842
843 */
844 public int getArmor()
845 {
846 return Armor;
847 }
848
849
850 /**
851 *
852 Also refered to as a "low armor". Ranges from 0 to 50 points.
853
854 */
855 protected
856 int SmallArmor =
857 0;
858
859
860 /**
861 * Whether property 'SmallArmor' was received from GB2004.
862 */
863 protected boolean SmallArmor_Set = false;
864
865 @Override
866
867 /**
868 *
869 Also refered to as a "low armor". Ranges from 0 to 50 points.
870
871 */
872 public int getSmallArmor()
873 {
874 return SmallArmor;
875 }
876
877
878 /**
879 *
880 If we are firing in secondary firing mode.
881
882 */
883 protected
884 boolean AltFiring =
885 false;
886
887
888 /**
889 * Whether property 'AltFiring' was received from GB2004.
890 */
891 protected boolean AltFiring_Set = false;
892
893 @Override
894
895 /**
896 *
897 If we are firing in secondary firing mode.
898
899 */
900 public boolean isAltFiring()
901 {
902 return AltFiring;
903 }
904
905
906 /**
907 *
908 If we are currently crouched.
909
910 */
911 protected
912 boolean Crouched =
913 false;
914
915
916 /**
917 * Whether property 'Crouched' was received from GB2004.
918 */
919 protected boolean Crouched_Set = false;
920
921 @Override
922
923 /**
924 *
925 If we are currently crouched.
926
927 */
928 public boolean isCrouched()
929 {
930 return Crouched;
931 }
932
933
934 /**
935 *
936 If we are currently in walking mode.
937
938 */
939 protected
940 boolean Walking =
941 false;
942
943
944 /**
945 * Whether property 'Walking' was received from GB2004.
946 */
947 protected boolean Walking_Set = false;
948
949 @Override
950
951 /**
952 *
953 If we are currently in walking mode.
954
955 */
956 public boolean isWalking()
957 {
958 return Walking;
959 }
960
961
962 /**
963 *
964 Holds current floor location under the bot.
965
966 */
967 protected
968 Location FloorLocation =
969 null;
970
971
972 /**
973 * Whether property 'FloorLocation' was received from GB2004.
974 */
975 protected boolean FloorLocation_Set = false;
976
977 @Override
978
979 /**
980 *
981 Holds current floor location under the bot.
982
983 */
984 public Location getFloorLocation()
985 {
986 return FloorLocation;
987 }
988
989
990 /**
991 *
992 Holds current floor normal under the bot.
993
994 */
995 protected
996 Location FloorNormal =
997 null;
998
999
1000 /**
1001 * Whether property 'FloorNormal' was received from GB2004.
1002 */
1003 protected boolean FloorNormal_Set = false;
1004
1005 @Override
1006
1007 /**
1008 *
1009 Holds current floor normal under the bot.
1010
1011 */
1012 public Location getFloorNormal()
1013 {
1014 return FloorNormal;
1015 }
1016
1017
1018 /**
1019 *
1020 Name of the current combo (None if no combo active).
1021 Can be xGame.ComboBerserk, xGame.ComboDefensive, xGame.ComboInvis or xGame.ComboSpeed.
1022 To trigger combo adrenaline needs to be at 100 (maximum) and no other combo can be active.
1023
1024 */
1025 protected
1026 String Combo =
1027 null;
1028
1029
1030 /**
1031 * Whether property 'Combo' was received from GB2004.
1032 */
1033 protected boolean Combo_Set = false;
1034
1035 @Override
1036
1037 /**
1038 *
1039 Name of the current combo (None if no combo active).
1040 Can be xGame.ComboBerserk, xGame.ComboDefensive, xGame.ComboInvis or xGame.ComboSpeed.
1041 To trigger combo adrenaline needs to be at 100 (maximum) and no other combo can be active.
1042
1043 */
1044 public String getCombo()
1045 {
1046 return Combo;
1047 }
1048
1049
1050 /**
1051 *
1052 Time when the UDamage effect expires. If the number is higher then the current
1053 time, it means the bot has UDamage effect active right now.
1054
1055 */
1056 protected
1057 double UDamageTime =
1058 0;
1059
1060
1061 /**
1062 * Whether property 'UDamageTime' was received from GB2004.
1063 */
1064 protected boolean UDamageTime_Set = false;
1065
1066 @Override
1067
1068 /**
1069 *
1070 Time when the UDamage effect expires. If the number is higher then the current
1071 time, it means the bot has UDamage effect active right now.
1072
1073 */
1074 public double getUDamageTime()
1075 {
1076 return UDamageTime;
1077 }
1078
1079
1080 /**
1081 *
1082 Name of the current BDI action.
1083
1084 */
1085 protected
1086 String Action =
1087 null;
1088
1089
1090 /**
1091 * Whether property 'Action' was received from GB2004.
1092 */
1093 protected boolean Action_Set = false;
1094
1095 @Override
1096
1097 /**
1098 *
1099 Name of the current BDI action.
1100
1101 */
1102 public String getAction()
1103 {
1104 return Action;
1105 }
1106
1107
1108 /**
1109 *
1110 For UE2. Holds left emoticon of the bot, "None" means none set.
1111
1112 */
1113 protected
1114 String EmotLeft =
1115 null;
1116
1117
1118 /**
1119 * Whether property 'EmotLeft' was received from GB2004.
1120 */
1121 protected boolean EmotLeft_Set = false;
1122
1123 @Override
1124
1125 /**
1126 *
1127 For UE2. Holds left emoticon of the bot, "None" means none set.
1128
1129 */
1130 public String getEmotLeft()
1131 {
1132 return EmotLeft;
1133 }
1134
1135
1136 /**
1137 *
1138 For UE2. Holds center emoticon of the bot, "None" means none set.
1139
1140 */
1141 protected
1142 String EmotCenter =
1143 null;
1144
1145
1146 /**
1147 * Whether property 'EmotCenter' was received from GB2004.
1148 */
1149 protected boolean EmotCenter_Set = false;
1150
1151 @Override
1152
1153 /**
1154 *
1155 For UE2. Holds center emoticon of the bot, "None" means none set.
1156
1157 */
1158 public String getEmotCenter()
1159 {
1160 return EmotCenter;
1161 }
1162
1163
1164 /**
1165 *
1166 For UE2. Holds right emoticon of the bot, "None" means none set.
1167
1168 */
1169 protected
1170 String EmotRight =
1171 null;
1172
1173
1174 /**
1175 * Whether property 'EmotRight' was received from GB2004.
1176 */
1177 protected boolean EmotRight_Set = false;
1178
1179 @Override
1180
1181 /**
1182 *
1183 For UE2. Holds right emoticon of the bot, "None" means none set.
1184
1185 */
1186 public String getEmotRight()
1187 {
1188 return EmotRight;
1189 }
1190
1191
1192 /**
1193 *
1194 For UE2. Holds the bubble of the emoticon of the bot, "None" means none set.
1195
1196 */
1197 protected
1198 String Bubble =
1199 null;
1200
1201
1202 /**
1203 * Whether property 'Bubble' was received from GB2004.
1204 */
1205 protected boolean Bubble_Set = false;
1206
1207 @Override
1208
1209 /**
1210 *
1211 For UE2. Holds the bubble of the emoticon of the bot, "None" means none set.
1212
1213 */
1214 public String getBubble()
1215 {
1216 return Bubble;
1217 }
1218
1219
1220 /**
1221 *
1222 For UE2. Current played animation of the bot.
1223
1224 */
1225 protected
1226 String Anim =
1227 null;
1228
1229
1230 /**
1231 * Whether property 'Anim' was received from GB2004.
1232 */
1233 protected boolean Anim_Set = false;
1234
1235 @Override
1236
1237 /**
1238 *
1239 For UE2. Current played animation of the bot.
1240
1241 */
1242 public String getAnim()
1243 {
1244 return Anim;
1245 }
1246
1247
1248 private SelfLocal localPart = null;
1249
1250 @Override
1251 public SelfLocal
1252 getLocal() {
1253 if (localPart != null) return localPart;
1254 return localPart = new
1255 SelfLocalMessage();
1256 }
1257
1258 private SelfShared sharedPart = null;
1259
1260 @Override
1261 public SelfShared
1262 getShared() {
1263 if (sharedPart != null) return sharedPart;
1264 return sharedPart = new
1265 SelfSharedMessage();
1266 }
1267
1268 private SelfStatic staticPart = null;
1269
1270 @Override
1271 public SelfStatic
1272 getStatic() {
1273 if (staticPart != null) return staticPart;
1274 return staticPart = new
1275 SelfStaticMessage();
1276 }
1277
1278 /**
1279 *
1280 Implementation of the local part of the GameBots2004 message SLF, used
1281 to facade SLFMessage.
1282
1283 *
1284 * <p></p><p></p>
1285 * Complete message documentation:
1286 *
1287 Synchronous message. Information about your bot's state.
1288
1289 */
1290 public class SelfLocalMessage
1291 extends
1292 SelfLocal
1293 {
1294
1295 @Override
1296 public
1297 SelfLocalMessage clone() {
1298 return this;
1299 }
1300
1301 public SelfLocalMessage getLocal() {
1302 return this;
1303 }
1304 public ISharedWorldObject getShared() {
1305 throw new UnsupportedOperationException("Could not return LOCAL as SHARED");
1306 }
1307 public IStaticWorldObject getStatic() {
1308 throw new UnsupportedOperationException("Could not return LOCAL as STATIC");
1309 }
1310
1311 /**
1312 * Unique Id of this self message instance.
1313 */
1314 public UnrealId getId()
1315 {
1316 return Id;
1317 }
1318
1319 /**
1320 * Unique Id of this bot.
1321 */
1322 public UnrealId getBotId()
1323 {
1324 return BotId;
1325 }
1326
1327 /**
1328 * Human readable bot name.
1329 */
1330 public String getName()
1331 {
1332 return Name;
1333 }
1334
1335 /**
1336 * If we are vehicle just these attr. are sent in SLF: "Id","Vehicle""Rotation", "Location","Velocity ","Name ","Team" ,"Health"
1337 "Armor","Adrenaline", "FloorLocation", "FloorNormal".
1338 */
1339 public boolean isVehicle()
1340 {
1341 return Vehicle;
1342 }
1343
1344 /**
1345 *
1346 An absolute location of the bot.
1347
1348 */
1349 public Location getLocation()
1350 {
1351 return Location;
1352 }
1353
1354 /**
1355 *
1356 Absolute velocity of the bot as a vector of movement per one
1357 game second.
1358
1359 */
1360 public Velocity getVelocity()
1361 {
1362 return Velocity;
1363 }
1364
1365 /**
1366 *
1367 Which direction the bot is facing in absolute terms.
1368
1369 */
1370 public Rotation getRotation()
1371 {
1372 return Rotation;
1373 }
1374
1375 /**
1376 *
1377 What team the bot is on. 255 is no team. 0-3 are red,
1378 blue, green, gold in that order.
1379
1380 */
1381 public int getTeam()
1382 {
1383 return Team;
1384 }
1385
1386 /**
1387 *
1388 Id of the weapon we are holding. This is unique Id of an
1389 item in our inventory and is different from the Id of the
1390 item we pick up from the ground! We can parse this string to
1391 look which weapon we hold. Weapon strings to look for
1392 include: "AssaultRifle", "ShieldGun", "FlakCannon",
1393 "BioRifle", "ShockRifle", "LinkGun", "SniperRifle",
1394 "RocketLauncher", "Minigun", "LightingGun", "Translocator".
1395 TODO: Look if this is all.
1396
1397 */
1398 public String getWeapon()
1399 {
1400 return Weapon;
1401 }
1402
1403 /**
1404 * If the bot is shooting or not.
1405 */
1406 public boolean isShooting()
1407 {
1408 return Shooting;
1409 }
1410
1411 /**
1412 *
1413 How much health the bot has left. Starts at 100, ranges from
1414 0 to 200.
1415
1416 */
1417 public int getHealth()
1418 {
1419 return Health;
1420 }
1421
1422 /**
1423 *
1424 How much ammo the bot has left for current weapon primary
1425 mode.
1426
1427 */
1428 public int getPrimaryAmmo()
1429 {
1430 return PrimaryAmmo;
1431 }
1432
1433 /**
1434 *
1435 How much ammo the bot has left for current weapon secondary
1436 mode. Weapon does not have to support sec. fire mode.
1437
1438 */
1439 public int getSecondaryAmmo()
1440 {
1441 return SecondaryAmmo;
1442 }
1443
1444 /**
1445 * How much adrenaline the bot has.
1446 */
1447 public int getAdrenaline()
1448 {
1449 return Adrenaline;
1450 }
1451
1452 /**
1453 *
1454 Combined size of high armor and low armor (or small armor). The high and low armor are tracked
1455 separately. Low armor is limited to 50 points, while the
1456 high armor can have up to 150 points. Both stacks can have a combined size of 150 points as well,
1457 so if low armor is already at 50 points, high armor can have
1458 100 points at max.
1459
1460 */
1461 public int getArmor()
1462 {
1463 return Armor;
1464 }
1465
1466 /**
1467 *
1468 Also refered to as a "low armor". Ranges from 0 to 50 points.
1469
1470 */
1471 public int getSmallArmor()
1472 {
1473 return SmallArmor;
1474 }
1475
1476 /**
1477 *
1478 If we are firing in secondary firing mode.
1479
1480 */
1481 public boolean isAltFiring()
1482 {
1483 return AltFiring;
1484 }
1485
1486 /**
1487 *
1488 If we are currently crouched.
1489
1490 */
1491 public boolean isCrouched()
1492 {
1493 return Crouched;
1494 }
1495
1496 /**
1497 *
1498 If we are currently in walking mode.
1499
1500 */
1501 public boolean isWalking()
1502 {
1503 return Walking;
1504 }
1505
1506 /**
1507 *
1508 Holds current floor location under the bot.
1509
1510 */
1511 public Location getFloorLocation()
1512 {
1513 return FloorLocation;
1514 }
1515
1516 /**
1517 *
1518 Holds current floor normal under the bot.
1519
1520 */
1521 public Location getFloorNormal()
1522 {
1523 return FloorNormal;
1524 }
1525
1526 /**
1527 *
1528 Name of the current combo (None if no combo active).
1529 Can be xGame.ComboBerserk, xGame.ComboDefensive, xGame.ComboInvis or xGame.ComboSpeed.
1530 To trigger combo adrenaline needs to be at 100 (maximum) and no other combo can be active.
1531
1532 */
1533 public String getCombo()
1534 {
1535 return Combo;
1536 }
1537
1538 /**
1539 *
1540 Time when the UDamage effect expires. If the number is higher then the current
1541 time, it means the bot has UDamage effect active right now.
1542
1543 */
1544 public double getUDamageTime()
1545 {
1546 return UDamageTime;
1547 }
1548
1549 /**
1550 *
1551 Name of the current BDI action.
1552
1553 */
1554 public String getAction()
1555 {
1556 return Action;
1557 }
1558
1559 /**
1560 *
1561 For UE2. Holds left emoticon of the bot, "None" means none set.
1562
1563 */
1564 public String getEmotLeft()
1565 {
1566 return EmotLeft;
1567 }
1568
1569 /**
1570 *
1571 For UE2. Holds center emoticon of the bot, "None" means none set.
1572
1573 */
1574 public String getEmotCenter()
1575 {
1576 return EmotCenter;
1577 }
1578
1579 /**
1580 *
1581 For UE2. Holds right emoticon of the bot, "None" means none set.
1582
1583 */
1584 public String getEmotRight()
1585 {
1586 return EmotRight;
1587 }
1588
1589 /**
1590 *
1591 For UE2. Holds the bubble of the emoticon of the bot, "None" means none set.
1592
1593 */
1594 public String getBubble()
1595 {
1596 return Bubble;
1597 }
1598
1599 /**
1600 *
1601 For UE2. Current played animation of the bot.
1602
1603 */
1604 public String getAnim()
1605 {
1606 return Anim;
1607 }
1608
1609
1610 public String toString() {
1611 return
1612 super.toString() + "[" +
1613
1614 "Id = " + String.valueOf(getId()
1615 ) + " | " +
1616
1617 "BotId = " + String.valueOf(getBotId()
1618 ) + " | " +
1619
1620 "Name = " + String.valueOf(getName()
1621 ) + " | " +
1622
1623 "Vehicle = " + String.valueOf(isVehicle()
1624 ) + " | " +
1625
1626 "Location = " + String.valueOf(getLocation()
1627 ) + " | " +
1628
1629 "Velocity = " + String.valueOf(getVelocity()
1630 ) + " | " +
1631
1632 "Rotation = " + String.valueOf(getRotation()
1633 ) + " | " +
1634
1635 "Team = " + String.valueOf(getTeam()
1636 ) + " | " +
1637
1638 "Weapon = " + String.valueOf(getWeapon()
1639 ) + " | " +
1640
1641 "Shooting = " + String.valueOf(isShooting()
1642 ) + " | " +
1643
1644 "Health = " + String.valueOf(getHealth()
1645 ) + " | " +
1646
1647 "PrimaryAmmo = " + String.valueOf(getPrimaryAmmo()
1648 ) + " | " +
1649
1650 "SecondaryAmmo = " + String.valueOf(getSecondaryAmmo()
1651 ) + " | " +
1652
1653 "Adrenaline = " + String.valueOf(getAdrenaline()
1654 ) + " | " +
1655
1656 "Armor = " + String.valueOf(getArmor()
1657 ) + " | " +
1658
1659 "SmallArmor = " + String.valueOf(getSmallArmor()
1660 ) + " | " +
1661
1662 "AltFiring = " + String.valueOf(isAltFiring()
1663 ) + " | " +
1664
1665 "Crouched = " + String.valueOf(isCrouched()
1666 ) + " | " +
1667
1668 "Walking = " + String.valueOf(isWalking()
1669 ) + " | " +
1670
1671 "FloorLocation = " + String.valueOf(getFloorLocation()
1672 ) + " | " +
1673
1674 "FloorNormal = " + String.valueOf(getFloorNormal()
1675 ) + " | " +
1676
1677 "Combo = " + String.valueOf(getCombo()
1678 ) + " | " +
1679
1680 "UDamageTime = " + String.valueOf(getUDamageTime()
1681 ) + " | " +
1682
1683 "Action = " + String.valueOf(getAction()
1684 ) + " | " +
1685
1686 "EmotLeft = " + String.valueOf(getEmotLeft()
1687 ) + " | " +
1688
1689 "EmotCenter = " + String.valueOf(getEmotCenter()
1690 ) + " | " +
1691
1692 "EmotRight = " + String.valueOf(getEmotRight()
1693 ) + " | " +
1694
1695 "Bubble = " + String.valueOf(getBubble()
1696 ) + " | " +
1697
1698 "Anim = " + String.valueOf(getAnim()
1699 ) + " | " +
1700
1701 "]";
1702 }
1703
1704
1705 public String toHtmlString() {
1706 return super.toString() + "[<br/>" +
1707
1708 "<b>Id</b> = " + String.valueOf(getId()
1709 ) + " <br/> " +
1710
1711 "<b>BotId</b> = " + String.valueOf(getBotId()
1712 ) + " <br/> " +
1713
1714 "<b>Name</b> = " + String.valueOf(getName()
1715 ) + " <br/> " +
1716
1717 "<b>Vehicle</b> = " + String.valueOf(isVehicle()
1718 ) + " <br/> " +
1719
1720 "<b>Location</b> = " + String.valueOf(getLocation()
1721 ) + " <br/> " +
1722
1723 "<b>Velocity</b> = " + String.valueOf(getVelocity()
1724 ) + " <br/> " +
1725
1726 "<b>Rotation</b> = " + String.valueOf(getRotation()
1727 ) + " <br/> " +
1728
1729 "<b>Team</b> = " + String.valueOf(getTeam()
1730 ) + " <br/> " +
1731
1732 "<b>Weapon</b> = " + String.valueOf(getWeapon()
1733 ) + " <br/> " +
1734
1735 "<b>Shooting</b> = " + String.valueOf(isShooting()
1736 ) + " <br/> " +
1737
1738 "<b>Health</b> = " + String.valueOf(getHealth()
1739 ) + " <br/> " +
1740
1741 "<b>PrimaryAmmo</b> = " + String.valueOf(getPrimaryAmmo()
1742 ) + " <br/> " +
1743
1744 "<b>SecondaryAmmo</b> = " + String.valueOf(getSecondaryAmmo()
1745 ) + " <br/> " +
1746
1747 "<b>Adrenaline</b> = " + String.valueOf(getAdrenaline()
1748 ) + " <br/> " +
1749
1750 "<b>Armor</b> = " + String.valueOf(getArmor()
1751 ) + " <br/> " +
1752
1753 "<b>SmallArmor</b> = " + String.valueOf(getSmallArmor()
1754 ) + " <br/> " +
1755
1756 "<b>AltFiring</b> = " + String.valueOf(isAltFiring()
1757 ) + " <br/> " +
1758
1759 "<b>Crouched</b> = " + String.valueOf(isCrouched()
1760 ) + " <br/> " +
1761
1762 "<b>Walking</b> = " + String.valueOf(isWalking()
1763 ) + " <br/> " +
1764
1765 "<b>FloorLocation</b> = " + String.valueOf(getFloorLocation()
1766 ) + " <br/> " +
1767
1768 "<b>FloorNormal</b> = " + String.valueOf(getFloorNormal()
1769 ) + " <br/> " +
1770
1771 "<b>Combo</b> = " + String.valueOf(getCombo()
1772 ) + " <br/> " +
1773
1774 "<b>UDamageTime</b> = " + String.valueOf(getUDamageTime()
1775 ) + " <br/> " +
1776
1777 "<b>Action</b> = " + String.valueOf(getAction()
1778 ) + " <br/> " +
1779
1780 "<b>EmotLeft</b> = " + String.valueOf(getEmotLeft()
1781 ) + " <br/> " +
1782
1783 "<b>EmotCenter</b> = " + String.valueOf(getEmotCenter()
1784 ) + " <br/> " +
1785
1786 "<b>EmotRight</b> = " + String.valueOf(getEmotRight()
1787 ) + " <br/> " +
1788
1789 "<b>Bubble</b> = " + String.valueOf(getBubble()
1790 ) + " <br/> " +
1791
1792 "<b>Anim</b> = " + String.valueOf(getAnim()
1793 ) + " <br/> " +
1794
1795 "<br/>]";
1796 }
1797
1798
1799 // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=all]) ---
1800
1801 // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=all]) ---
1802
1803 // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=local+classtype[@name=message]) ---
1804
1805 // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=local+classtype[@name=message]) ---
1806
1807 }
1808
1809 /**
1810 *
1811 Implementation of the static part of the GameBots2004 message SLF, used
1812 to facade SLFMessage.
1813
1814 *
1815 * <p></p><p></p>
1816 * Complete message documentation:
1817 *
1818 Synchronous message. Information about your bot's state.
1819
1820 */
1821 public class SelfStaticMessage
1822 extends
1823 SelfStatic
1824 {
1825
1826 @Override
1827 public
1828 SelfStaticMessage clone() {
1829 return this;
1830 }
1831
1832 /**
1833 * Unique Id of this self message instance.
1834 */
1835 public UnrealId getId()
1836 {
1837 return Id;
1838 }
1839
1840
1841 @Override
1842 public boolean isDifferentFrom(IStaticWorldObject other)
1843 {
1844 if (other == null) //early fail
1845 {
1846 return true;
1847 }
1848 else if (other == this) //early out
1849 {
1850 return false;
1851 }
1852 else
1853 {
1854 SelfStatic obj = (SelfStatic) other;
1855
1856
1857 if ( !(
1858 AdvancedEquals.equalsOrNull(this.getId()
1859 , obj.getId()
1860 )
1861 ) )
1862 {
1863 System.out.println("!!!!!PROPERTY UPDATE ERROR!!!! on property Id on object class SelfStatic");
1864 return true;
1865 }
1866
1867 }
1868 return false;
1869 }
1870
1871
1872 public String toString() {
1873 return
1874 super.toString() + "[" +
1875
1876 "Id = " + String.valueOf(getId()
1877 ) + " | " +
1878
1879 "]";
1880 }
1881
1882
1883 public String toHtmlString() {
1884 return super.toString() + "[<br/>" +
1885
1886 "<b>Id</b> = " + String.valueOf(getId()
1887 ) + " <br/> " +
1888
1889 "<br/>]";
1890 }
1891
1892
1893 // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=all]) ---
1894
1895 // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=all]) ---
1896
1897 // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=static+classtype[@name=message]) ---
1898
1899 // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=static+classtype[@name=message]) ---
1900
1901 }
1902
1903 /**
1904 *
1905 Implementation of the shared part of the GameBots2004 message SLF, used
1906 to facade SLFMessage.
1907
1908 *
1909 * <p></p><p></p>
1910 * Complete message documentation:
1911 *
1912 Synchronous message. Information about your bot's state.
1913
1914 */
1915 public class SelfSharedMessage
1916 extends
1917 SelfShared
1918 {
1919
1920
1921
1922 public SelfSharedMessage()
1923 {
1924
1925 }
1926
1927 @Override
1928 public
1929 SelfSharedMessage clone() {
1930 return this;
1931 }
1932
1933
1934
1935
1936 protected HashMap<PropertyId, ISharedProperty> propertyMap = new HashMap<PropertyId, ISharedProperty>(
1937 0
1938 );
1939
1940 @Override
1941 public ISharedProperty getProperty(PropertyId id) {
1942 return propertyMap.get(id);
1943 }
1944
1945 @Override
1946 public Map<PropertyId, ISharedProperty> getProperties() {
1947 return propertyMap;
1948 }
1949
1950
1951
1952 /**
1953 * Unique Id of this self message instance.
1954 */
1955 public UnrealId getId()
1956 {
1957 return Id;
1958 }
1959
1960
1961 public String toString() {
1962 return
1963 super.toString() + "[" +
1964
1965 "Id = " + String.valueOf(getId()
1966 ) + " | " +
1967
1968 "]";
1969 }
1970
1971
1972 public String toHtmlString() {
1973 return super.toString() + "[<br/>" +
1974
1975 "<b>Id</b> = " + String.valueOf(getId()
1976 ) + " <br/> " +
1977
1978 "<br/>]";
1979 }
1980
1981
1982 // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=all]) ---
1983
1984 // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=all]) ---
1985
1986 // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=shared+classtype[@name=message]) ---
1987
1988 // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=shared+classtype[@name=message]) ---
1989
1990 }
1991
1992
1993
1994
1995 @Override
1996 public IWorldObjectUpdateResult<IWorldObject> update(IWorldObject object) {
1997 if (object == null)
1998 {
1999 return new IWorldObjectUpdateResult.WorldObjectUpdateResult(IWorldObjectUpdateResult.Result.CREATED, this);
2000 }
2001 if (!( object instanceof SelfMessage) ) {
2002 throw new PogamutException("Can't update different class than SelfMessage, got class " + object.getClass().getSimpleName() + "!", this);
2003 }
2004 SelfMessage toUpdate = (SelfMessage)object;
2005
2006 boolean updated = false;
2007
2008 // UPDATING LOCAL PROPERTIES
2009
2010 if (!SafeEquals.equals(toUpdate.BotId, getBotId()
2011 )) {
2012 toUpdate.BotId=getBotId()
2013 ;
2014 updated = true;
2015 }
2016
2017 if (!SafeEquals.equals(toUpdate.Name, getName()
2018 )) {
2019 toUpdate.Name=getName()
2020 ;
2021 updated = true;
2022 }
2023
2024 if (toUpdate.Vehicle != isVehicle()
2025 ) {
2026 toUpdate.Vehicle=isVehicle()
2027 ;
2028 updated = true;
2029 }
2030
2031 if (!SafeEquals.equals(toUpdate.Location, getLocation()
2032 )) {
2033 toUpdate.Location=getLocation()
2034 ;
2035 updated = true;
2036 }
2037
2038 if (!SafeEquals.equals(toUpdate.Velocity, getVelocity()
2039 )) {
2040 toUpdate.Velocity=getVelocity()
2041 ;
2042 updated = true;
2043 }
2044
2045 if (!SafeEquals.equals(toUpdate.Rotation, getRotation()
2046 )) {
2047 toUpdate.Rotation=getRotation()
2048 ;
2049 updated = true;
2050 }
2051
2052 if (toUpdate.Team != getTeam()
2053 ) {
2054 toUpdate.Team=getTeam()
2055 ;
2056 updated = true;
2057 }
2058
2059 if (!SafeEquals.equals(toUpdate.Weapon, getWeapon()
2060 )) {
2061 toUpdate.Weapon=getWeapon()
2062 ;
2063 updated = true;
2064 }
2065
2066 if (toUpdate.Shooting != isShooting()
2067 ) {
2068 toUpdate.Shooting=isShooting()
2069 ;
2070 updated = true;
2071 }
2072
2073 if (toUpdate.Health != getHealth()
2074 ) {
2075 toUpdate.Health=getHealth()
2076 ;
2077 updated = true;
2078 }
2079
2080 if (toUpdate.PrimaryAmmo != getPrimaryAmmo()
2081 ) {
2082 toUpdate.PrimaryAmmo=getPrimaryAmmo()
2083 ;
2084 updated = true;
2085 }
2086
2087 if (toUpdate.SecondaryAmmo != getSecondaryAmmo()
2088 ) {
2089 toUpdate.SecondaryAmmo=getSecondaryAmmo()
2090 ;
2091 updated = true;
2092 }
2093
2094 if (toUpdate.Adrenaline != getAdrenaline()
2095 ) {
2096 toUpdate.Adrenaline=getAdrenaline()
2097 ;
2098 updated = true;
2099 }
2100
2101 if (toUpdate.Armor != getArmor()
2102 ) {
2103 toUpdate.Armor=getArmor()
2104 ;
2105 updated = true;
2106 }
2107
2108 if (toUpdate.SmallArmor != getSmallArmor()
2109 ) {
2110 toUpdate.SmallArmor=getSmallArmor()
2111 ;
2112 updated = true;
2113 }
2114
2115 if (toUpdate.AltFiring != isAltFiring()
2116 ) {
2117 toUpdate.AltFiring=isAltFiring()
2118 ;
2119 updated = true;
2120 }
2121
2122 if (toUpdate.Crouched != isCrouched()
2123 ) {
2124 toUpdate.Crouched=isCrouched()
2125 ;
2126 updated = true;
2127 }
2128
2129 if (toUpdate.Walking != isWalking()
2130 ) {
2131 toUpdate.Walking=isWalking()
2132 ;
2133 updated = true;
2134 }
2135
2136 if (!SafeEquals.equals(toUpdate.FloorLocation, getFloorLocation()
2137 )) {
2138 toUpdate.FloorLocation=getFloorLocation()
2139 ;
2140 updated = true;
2141 }
2142
2143 if (!SafeEquals.equals(toUpdate.FloorNormal, getFloorNormal()
2144 )) {
2145 toUpdate.FloorNormal=getFloorNormal()
2146 ;
2147 updated = true;
2148 }
2149
2150 if (!SafeEquals.equals(toUpdate.Combo, getCombo()
2151 )) {
2152 toUpdate.Combo=getCombo()
2153 ;
2154 updated = true;
2155 }
2156
2157 if (toUpdate.UDamageTime != getUDamageTime()
2158 ) {
2159 toUpdate.UDamageTime=getUDamageTime()
2160 ;
2161 updated = true;
2162 }
2163
2164 if (!SafeEquals.equals(toUpdate.Action, getAction()
2165 )) {
2166 toUpdate.Action=getAction()
2167 ;
2168 updated = true;
2169 }
2170
2171 if (!SafeEquals.equals(toUpdate.EmotLeft, getEmotLeft()
2172 )) {
2173 toUpdate.EmotLeft=getEmotLeft()
2174 ;
2175 updated = true;
2176 }
2177
2178 if (!SafeEquals.equals(toUpdate.EmotCenter, getEmotCenter()
2179 )) {
2180 toUpdate.EmotCenter=getEmotCenter()
2181 ;
2182 updated = true;
2183 }
2184
2185 if (!SafeEquals.equals(toUpdate.EmotRight, getEmotRight()
2186 )) {
2187 toUpdate.EmotRight=getEmotRight()
2188 ;
2189 updated = true;
2190 }
2191
2192 if (!SafeEquals.equals(toUpdate.Bubble, getBubble()
2193 )) {
2194 toUpdate.Bubble=getBubble()
2195 ;
2196 updated = true;
2197 }
2198
2199 if (!SafeEquals.equals(toUpdate.Anim, getAnim()
2200 )) {
2201 toUpdate.Anim=getAnim()
2202 ;
2203 updated = true;
2204 }
2205
2206
2207 // UPDATING SHARED PROPERTIES
2208
2209
2210 // UPDATE TIME
2211 toUpdate.SimTime = SimTime;
2212
2213 if (updated) {
2214 return new IWorldObjectUpdateResult.WorldObjectUpdateResult<IWorldObject>(IWorldObjectUpdateResult.Result.UPDATED, toUpdate);
2215 } else {
2216 return new IWorldObjectUpdateResult.WorldObjectUpdateResult<IWorldObject>(IWorldObjectUpdateResult.Result.SAME, toUpdate);
2217 }
2218 }
2219
2220 @Override
2221 public ILocalWorldObjectUpdatedEvent getLocalEvent() {
2222 return new SelfLocalImpl.SelfLocalUpdate
2223 (this.getLocal(), SimTime);
2224 }
2225
2226 @Override
2227 public ISharedWorldObjectUpdatedEvent getSharedEvent() {
2228 return new SelfSharedImpl.SelfSharedUpdate
2229 (this.getShared(), SimTime, this.getTeamId());
2230 }
2231
2232 @Override
2233 public IStaticWorldObjectUpdatedEvent getStaticEvent() {
2234 return new SelfStaticImpl.SelfStaticUpdate
2235 (this.getStatic(), SimTime);
2236 }
2237
2238
2239 public String toString() {
2240 return
2241 super.toString() + "[" +
2242
2243 "Id = " + String.valueOf(getId()
2244 ) + " | " +
2245
2246 "BotId = " + String.valueOf(getBotId()
2247 ) + " | " +
2248
2249 "Name = " + String.valueOf(getName()
2250 ) + " | " +
2251
2252 "Vehicle = " + String.valueOf(isVehicle()
2253 ) + " | " +
2254
2255 "Location = " + String.valueOf(getLocation()
2256 ) + " | " +
2257
2258 "Velocity = " + String.valueOf(getVelocity()
2259 ) + " | " +
2260
2261 "Rotation = " + String.valueOf(getRotation()
2262 ) + " | " +
2263
2264 "Team = " + String.valueOf(getTeam()
2265 ) + " | " +
2266
2267 "Weapon = " + String.valueOf(getWeapon()
2268 ) + " | " +
2269
2270 "Shooting = " + String.valueOf(isShooting()
2271 ) + " | " +
2272
2273 "Health = " + String.valueOf(getHealth()
2274 ) + " | " +
2275
2276 "PrimaryAmmo = " + String.valueOf(getPrimaryAmmo()
2277 ) + " | " +
2278
2279 "SecondaryAmmo = " + String.valueOf(getSecondaryAmmo()
2280 ) + " | " +
2281
2282 "Adrenaline = " + String.valueOf(getAdrenaline()
2283 ) + " | " +
2284
2285 "Armor = " + String.valueOf(getArmor()
2286 ) + " | " +
2287
2288 "SmallArmor = " + String.valueOf(getSmallArmor()
2289 ) + " | " +
2290
2291 "AltFiring = " + String.valueOf(isAltFiring()
2292 ) + " | " +
2293
2294 "Crouched = " + String.valueOf(isCrouched()
2295 ) + " | " +
2296
2297 "Walking = " + String.valueOf(isWalking()
2298 ) + " | " +
2299
2300 "FloorLocation = " + String.valueOf(getFloorLocation()
2301 ) + " | " +
2302
2303 "FloorNormal = " + String.valueOf(getFloorNormal()
2304 ) + " | " +
2305
2306 "Combo = " + String.valueOf(getCombo()
2307 ) + " | " +
2308
2309 "UDamageTime = " + String.valueOf(getUDamageTime()
2310 ) + " | " +
2311
2312 "Action = " + String.valueOf(getAction()
2313 ) + " | " +
2314
2315 "EmotLeft = " + String.valueOf(getEmotLeft()
2316 ) + " | " +
2317
2318 "EmotCenter = " + String.valueOf(getEmotCenter()
2319 ) + " | " +
2320
2321 "EmotRight = " + String.valueOf(getEmotRight()
2322 ) + " | " +
2323
2324 "Bubble = " + String.valueOf(getBubble()
2325 ) + " | " +
2326
2327 "Anim = " + String.valueOf(getAnim()
2328 ) + " | " +
2329
2330 "]";
2331 }
2332
2333
2334 public String toHtmlString() {
2335 return super.toString() + "[<br/>" +
2336
2337 "<b>Id</b> = " + String.valueOf(getId()
2338 ) + " <br/> " +
2339
2340 "<b>BotId</b> = " + String.valueOf(getBotId()
2341 ) + " <br/> " +
2342
2343 "<b>Name</b> = " + String.valueOf(getName()
2344 ) + " <br/> " +
2345
2346 "<b>Vehicle</b> = " + String.valueOf(isVehicle()
2347 ) + " <br/> " +
2348
2349 "<b>Location</b> = " + String.valueOf(getLocation()
2350 ) + " <br/> " +
2351
2352 "<b>Velocity</b> = " + String.valueOf(getVelocity()
2353 ) + " <br/> " +
2354
2355 "<b>Rotation</b> = " + String.valueOf(getRotation()
2356 ) + " <br/> " +
2357
2358 "<b>Team</b> = " + String.valueOf(getTeam()
2359 ) + " <br/> " +
2360
2361 "<b>Weapon</b> = " + String.valueOf(getWeapon()
2362 ) + " <br/> " +
2363
2364 "<b>Shooting</b> = " + String.valueOf(isShooting()
2365 ) + " <br/> " +
2366
2367 "<b>Health</b> = " + String.valueOf(getHealth()
2368 ) + " <br/> " +
2369
2370 "<b>PrimaryAmmo</b> = " + String.valueOf(getPrimaryAmmo()
2371 ) + " <br/> " +
2372
2373 "<b>SecondaryAmmo</b> = " + String.valueOf(getSecondaryAmmo()
2374 ) + " <br/> " +
2375
2376 "<b>Adrenaline</b> = " + String.valueOf(getAdrenaline()
2377 ) + " <br/> " +
2378
2379 "<b>Armor</b> = " + String.valueOf(getArmor()
2380 ) + " <br/> " +
2381
2382 "<b>SmallArmor</b> = " + String.valueOf(getSmallArmor()
2383 ) + " <br/> " +
2384
2385 "<b>AltFiring</b> = " + String.valueOf(isAltFiring()
2386 ) + " <br/> " +
2387
2388 "<b>Crouched</b> = " + String.valueOf(isCrouched()
2389 ) + " <br/> " +
2390
2391 "<b>Walking</b> = " + String.valueOf(isWalking()
2392 ) + " <br/> " +
2393
2394 "<b>FloorLocation</b> = " + String.valueOf(getFloorLocation()
2395 ) + " <br/> " +
2396
2397 "<b>FloorNormal</b> = " + String.valueOf(getFloorNormal()
2398 ) + " <br/> " +
2399
2400 "<b>Combo</b> = " + String.valueOf(getCombo()
2401 ) + " <br/> " +
2402
2403 "<b>UDamageTime</b> = " + String.valueOf(getUDamageTime()
2404 ) + " <br/> " +
2405
2406 "<b>Action</b> = " + String.valueOf(getAction()
2407 ) + " <br/> " +
2408
2409 "<b>EmotLeft</b> = " + String.valueOf(getEmotLeft()
2410 ) + " <br/> " +
2411
2412 "<b>EmotCenter</b> = " + String.valueOf(getEmotCenter()
2413 ) + " <br/> " +
2414
2415 "<b>EmotRight</b> = " + String.valueOf(getEmotRight()
2416 ) + " <br/> " +
2417
2418 "<b>Bubble</b> = " + String.valueOf(getBubble()
2419 ) + " <br/> " +
2420
2421 "<b>Anim</b> = " + String.valueOf(getAnim()
2422 ) + " <br/> " +
2423
2424 "<br/>]";
2425 }
2426
2427
2428 // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=all]) ---
2429
2430 // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=all]) ---
2431
2432 // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=base+classtype[@name=message]) ---
2433
2434 // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=base+classtype[@name=message]) ---
2435
2436 }
2437