1 package cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages;
2
3
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
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 public class GameInfoMessage
30 extends
31 GameInfo
32 implements IWorldObjectUpdatedEvent, ICompositeWorldObjectUpdatedEvent
33
34 {
35
36
37
38
39
40
41 public GameInfoMessage()
42 {
43 }
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187 public GameInfoMessage(
188 String Gametype, String Level, boolean WeaponStay, double TimeLimit, int FragLimit, long GoalTeamScore, int MaxTeams, int MaxTeamSize, Location RedBaseLocation, Location BlueBaseLocation, Location FirstDomPointLocation, Location SecondDomPointLocation, boolean GamePaused, boolean BotsPaused, Location FactoryLocation, double FactoryRadius, Location DisperserLocation, double DisperserRadius, double FactoryAdrenalineCount, String FactorySpawnType
189 ) {
190
191 this.Gametype = Gametype;
192
193 this.Level = Level;
194
195 this.WeaponStay = WeaponStay;
196
197 this.TimeLimit = TimeLimit;
198
199 this.FragLimit = FragLimit;
200
201 this.GoalTeamScore = GoalTeamScore;
202
203 this.MaxTeams = MaxTeams;
204
205 this.MaxTeamSize = MaxTeamSize;
206
207 this.RedBaseLocation = RedBaseLocation;
208
209 this.BlueBaseLocation = BlueBaseLocation;
210
211 this.FirstDomPointLocation = FirstDomPointLocation;
212
213 this.SecondDomPointLocation = SecondDomPointLocation;
214
215 this.GamePaused = GamePaused;
216
217 this.BotsPaused = BotsPaused;
218
219 this.FactoryLocation = FactoryLocation;
220
221 this.FactoryRadius = FactoryRadius;
222
223 this.DisperserLocation = DisperserLocation;
224
225 this.DisperserRadius = DisperserRadius;
226
227 this.FactoryAdrenalineCount = FactoryAdrenalineCount;
228
229 this.FactorySpawnType = FactorySpawnType;
230
231 }
232
233
234
235
236
237
238 public GameInfoMessage(GameInfoMessage original) {
239
240 this.Gametype = original.getGametype()
241 ;
242
243 this.Level = original.getLevel()
244 ;
245
246 this.WeaponStay = original.isWeaponStay()
247 ;
248
249 this.TimeLimit = original.getTimeLimit()
250 ;
251
252 this.FragLimit = original.getFragLimit()
253 ;
254
255 this.GoalTeamScore = original.getGoalTeamScore()
256 ;
257
258 this.MaxTeams = original.getMaxTeams()
259 ;
260
261 this.MaxTeamSize = original.getMaxTeamSize()
262 ;
263
264 this.RedBaseLocation = original.getRedBaseLocation()
265 ;
266
267 this.BlueBaseLocation = original.getBlueBaseLocation()
268 ;
269
270 this.FirstDomPointLocation = original.getFirstDomPointLocation()
271 ;
272
273 this.SecondDomPointLocation = original.getSecondDomPointLocation()
274 ;
275
276 this.GamePaused = original.isGamePaused()
277 ;
278
279 this.BotsPaused = original.isBotsPaused()
280 ;
281
282 this.FactoryLocation = original.getFactoryLocation()
283 ;
284
285 this.FactoryRadius = original.getFactoryRadius()
286 ;
287
288 this.DisperserLocation = original.getDisperserLocation()
289 ;
290
291 this.DisperserRadius = original.getDisperserRadius()
292 ;
293
294 this.FactoryAdrenalineCount = original.getFactoryAdrenalineCount()
295 ;
296
297 this.FactorySpawnType = original.getFactorySpawnType()
298 ;
299
300 this.TeamId = original.getTeamId();
301
302 this.SimTime = original.getSimTime();
303 }
304
305
306 public UnrealId getId() {
307 return cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo.GameInfoId;
308 }
309
310
311 protected ITeamId TeamId;
312
313
314
315
316 protected void setTeamId(ITeamId TeamId) {
317 this.TeamId = TeamId;
318 }
319
320 public ITeamId getTeamId() {
321 return TeamId;
322 }
323
324
325
326
327
328
329
330
331
332
333 protected
334 String Gametype =
335 null;
336
337
338
339
340
341 protected boolean Gametype_Set = false;
342
343 @Override
344
345
346
347
348
349
350
351 public String getGametype()
352 {
353 return Gametype;
354 }
355
356
357
358
359
360 protected
361 String Level =
362 null;
363
364
365
366
367
368 protected boolean Level_Set = false;
369
370 @Override
371
372
373
374
375 public String getLevel()
376 {
377 return Level;
378 }
379
380
381
382
383
384
385
386 protected
387 boolean WeaponStay =
388 false;
389
390
391
392
393
394 protected boolean WeaponStay_Set = false;
395
396 @Override
397
398
399
400
401
402
403 public boolean isWeaponStay()
404 {
405 return WeaponStay;
406 }
407
408
409
410
411
412
413
414
415 protected
416 double TimeLimit =
417 0;
418
419
420
421
422
423 protected boolean TimeLimit_Set = false;
424
425 @Override
426
427
428
429
430
431
432
433 public double getTimeLimit()
434 {
435 return TimeLimit;
436 }
437
438
439
440
441
442
443
444 protected
445 int FragLimit =
446 0;
447
448
449
450
451
452 protected boolean FragLimit_Set = false;
453
454 @Override
455
456
457
458
459
460
461 public int getFragLimit()
462 {
463 return FragLimit;
464 }
465
466
467
468
469
470
471
472
473 protected
474 long GoalTeamScore =
475 0;
476
477
478
479
480
481 protected boolean GoalTeamScore_Set = false;
482
483 @Override
484
485
486
487
488
489
490
491 public long getGoalTeamScore()
492 {
493 return GoalTeamScore;
494 }
495
496
497
498
499
500
501
502
503
504 protected
505 int MaxTeams =
506 0;
507
508
509
510
511
512 protected boolean MaxTeams_Set = false;
513
514 @Override
515
516
517
518
519
520
521
522
523 public int getMaxTeams()
524 {
525 return MaxTeams;
526 }
527
528
529
530
531
532
533
534
535 protected
536 int MaxTeamSize =
537 0;
538
539
540
541
542
543 protected boolean MaxTeamSize_Set = false;
544
545 @Override
546
547
548
549
550
551
552
553 public int getMaxTeamSize()
554 {
555 return MaxTeamSize;
556 }
557
558
559
560
561
562
563
564 protected
565 Location RedBaseLocation =
566 null;
567
568
569
570
571
572 protected boolean RedBaseLocation_Set = false;
573
574 @Override
575
576
577
578
579
580
581 public Location getRedBaseLocation()
582 {
583 return RedBaseLocation;
584 }
585
586
587
588
589
590
591
592 protected
593 Location BlueBaseLocation =
594 null;
595
596
597
598
599
600 protected boolean BlueBaseLocation_Set = false;
601
602 @Override
603
604
605
606
607
608
609 public Location getBlueBaseLocation()
610 {
611 return BlueBaseLocation;
612 }
613
614
615
616
617
618
619
620 protected
621 Location FirstDomPointLocation =
622 null;
623
624
625
626
627
628 protected boolean FirstDomPointLocation_Set = false;
629
630 @Override
631
632
633
634
635
636
637 public Location getFirstDomPointLocation()
638 {
639 return FirstDomPointLocation;
640 }
641
642
643
644
645
646
647
648 protected
649 Location SecondDomPointLocation =
650 null;
651
652
653
654
655
656 protected boolean SecondDomPointLocation_Set = false;
657
658 @Override
659
660
661
662
663
664
665 public Location getSecondDomPointLocation()
666 {
667 return SecondDomPointLocation;
668 }
669
670
671
672
673
674
675
676 protected
677 boolean GamePaused =
678 false;
679
680
681
682
683
684 protected boolean GamePaused_Set = false;
685
686 @Override
687
688
689
690
691
692
693 public boolean isGamePaused()
694 {
695 return GamePaused;
696 }
697
698
699
700
701
702
703
704
705 protected
706 boolean BotsPaused =
707 false;
708
709
710
711
712
713 protected boolean BotsPaused_Set = false;
714
715 @Override
716
717
718
719
720
721
722
723 public boolean isBotsPaused()
724 {
725 return BotsPaused;
726 }
727
728
729
730
731
732
733
734 protected
735 Location FactoryLocation =
736 null;
737
738
739
740
741
742 protected boolean FactoryLocation_Set = false;
743
744 @Override
745
746
747
748
749
750
751 public Location getFactoryLocation()
752 {
753 return FactoryLocation;
754 }
755
756
757
758
759
760
761
762 protected
763 double FactoryRadius =
764 0;
765
766
767
768
769
770 protected boolean FactoryRadius_Set = false;
771
772 @Override
773
774
775
776
777
778
779 public double getFactoryRadius()
780 {
781 return FactoryRadius;
782 }
783
784
785
786
787
788
789
790 protected
791 Location DisperserLocation =
792 null;
793
794
795
796
797
798 protected boolean DisperserLocation_Set = false;
799
800 @Override
801
802
803
804
805
806
807 public Location getDisperserLocation()
808 {
809 return DisperserLocation;
810 }
811
812
813
814
815
816
817
818 protected
819 double DisperserRadius =
820 0;
821
822
823
824
825
826 protected boolean DisperserRadius_Set = false;
827
828 @Override
829
830
831
832
833
834
835 public double getDisperserRadius()
836 {
837 return DisperserRadius;
838 }
839
840
841
842
843
844
845
846 protected
847 double FactoryAdrenalineCount =
848 0;
849
850
851
852
853
854 protected boolean FactoryAdrenalineCount_Set = false;
855
856 @Override
857
858
859
860
861
862
863 public double getFactoryAdrenalineCount()
864 {
865 return FactoryAdrenalineCount;
866 }
867
868
869
870
871
872
873
874 protected
875 String FactorySpawnType =
876 null;
877
878
879
880
881
882 protected boolean FactorySpawnType_Set = false;
883
884 @Override
885
886
887
888
889
890
891 public String getFactorySpawnType()
892 {
893 return FactorySpawnType;
894 }
895
896
897 private GameInfoLocal localPart = null;
898
899 @Override
900 public GameInfoLocal
901 getLocal() {
902 if (localPart != null) return localPart;
903 return localPart = new
904 GameInfoLocalMessage();
905 }
906
907 private GameInfoShared sharedPart = null;
908
909 @Override
910 public GameInfoShared
911 getShared() {
912 if (sharedPart != null) return sharedPart;
913 return sharedPart = new
914 GameInfoSharedMessage();
915 }
916
917 private GameInfoStatic staticPart = null;
918
919 @Override
920 public GameInfoStatic
921 getStatic() {
922 if (staticPart != null) return staticPart;
923 return staticPart = new
924 GameInfoStaticMessage();
925 }
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941 public class GameInfoLocalMessage
942 extends
943 GameInfoLocal
944 {
945
946
947 public UnrealId getId() {
948 return cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo.GameInfoId;
949 }
950
951 @Override
952 public
953 GameInfoLocalMessage clone() {
954 return this;
955 }
956
957 public GameInfoLocalMessage getLocal() {
958 return this;
959 }
960 public ISharedWorldObject getShared() {
961 throw new UnsupportedOperationException("Could not return LOCAL as SHARED");
962 }
963 public IStaticWorldObject getStatic() {
964 throw new UnsupportedOperationException("Could not return LOCAL as STATIC");
965 }
966
967
968 public String toString() {
969 return
970 super.toString() + "[" +
971
972 "]";
973 }
974
975
976 public String toHtmlString() {
977 return super.toString() + "[<br/>" +
978
979 "<br/>]";
980 }
981
982
983
984
985
986
987
988
989
990
991 }
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007 public class GameInfoStaticMessage
1008 extends
1009 GameInfoStatic
1010 {
1011
1012
1013 public UnrealId getId() {
1014 return cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo.GameInfoId;
1015 }
1016
1017 @Override
1018 public
1019 GameInfoStaticMessage clone() {
1020 return this;
1021 }
1022
1023
1024
1025
1026
1027
1028
1029 public String getGametype()
1030 {
1031 return Gametype;
1032 }
1033
1034
1035
1036
1037 public String getLevel()
1038 {
1039 return Level;
1040 }
1041
1042
1043
1044
1045
1046
1047
1048
1049 public int getMaxTeams()
1050 {
1051 return MaxTeams;
1052 }
1053
1054
1055
1056
1057
1058
1059 public Location getRedBaseLocation()
1060 {
1061 return RedBaseLocation;
1062 }
1063
1064
1065
1066
1067
1068
1069 public Location getBlueBaseLocation()
1070 {
1071 return BlueBaseLocation;
1072 }
1073
1074
1075
1076
1077
1078
1079 public Location getFirstDomPointLocation()
1080 {
1081 return FirstDomPointLocation;
1082 }
1083
1084
1085
1086
1087
1088
1089 public Location getSecondDomPointLocation()
1090 {
1091 return SecondDomPointLocation;
1092 }
1093
1094
1095
1096
1097
1098
1099 public Location getFactoryLocation()
1100 {
1101 return FactoryLocation;
1102 }
1103
1104
1105
1106
1107
1108
1109 public double getFactoryRadius()
1110 {
1111 return FactoryRadius;
1112 }
1113
1114
1115
1116
1117
1118
1119 public Location getDisperserLocation()
1120 {
1121 return DisperserLocation;
1122 }
1123
1124
1125
1126
1127
1128
1129 public double getDisperserRadius()
1130 {
1131 return DisperserRadius;
1132 }
1133
1134
1135
1136
1137
1138
1139 public double getFactoryAdrenalineCount()
1140 {
1141 return FactoryAdrenalineCount;
1142 }
1143
1144
1145
1146
1147
1148
1149 public String getFactorySpawnType()
1150 {
1151 return FactorySpawnType;
1152 }
1153
1154
1155 @Override
1156 public boolean isDifferentFrom(IStaticWorldObject other)
1157 {
1158 if (other == null)
1159 {
1160 return true;
1161 }
1162 else if (other == this)
1163 {
1164 return false;
1165 }
1166 else
1167 {
1168 GameInfoStatic obj = (GameInfoStatic) other;
1169
1170
1171 if ( !(
1172 AdvancedEquals.equalsOrNull(this.getGametype()
1173 , obj.getGametype()
1174 )
1175 ) )
1176 {
1177 System.out.println("!!!!!PROPERTY UPDATE ERROR!!!! on property Gametype on object class GameInfoStatic");
1178 return true;
1179 }
1180
1181 if ( !(
1182 AdvancedEquals.equalsOrNull(this.getLevel()
1183 , obj.getLevel()
1184 )
1185 ) )
1186 {
1187 System.out.println("!!!!!PROPERTY UPDATE ERROR!!!! on property Level on object class GameInfoStatic");
1188 return true;
1189 }
1190
1191 if ( !(this.getMaxTeams()
1192
1193 == obj.getMaxTeams()
1194 ) )
1195 {
1196 System.out.println("!!!!!PROPERTY UPDATE ERROR!!!! on property MaxTeams on object class GameInfoStatic");
1197 return true;
1198 }
1199
1200 if ( !(
1201 AdvancedEquals.equalsOrNull(this.getRedBaseLocation()
1202 , obj.getRedBaseLocation()
1203 )
1204 ) )
1205 {
1206 System.out.println("!!!!!PROPERTY UPDATE ERROR!!!! on property RedBaseLocation on object class GameInfoStatic");
1207 return true;
1208 }
1209
1210 if ( !(
1211 AdvancedEquals.equalsOrNull(this.getBlueBaseLocation()
1212 , obj.getBlueBaseLocation()
1213 )
1214 ) )
1215 {
1216 System.out.println("!!!!!PROPERTY UPDATE ERROR!!!! on property BlueBaseLocation on object class GameInfoStatic");
1217 return true;
1218 }
1219
1220 if ( !(
1221 AdvancedEquals.equalsOrNull(this.getFirstDomPointLocation()
1222 , obj.getFirstDomPointLocation()
1223 )
1224 ) )
1225 {
1226 System.out.println("!!!!!PROPERTY UPDATE ERROR!!!! on property FirstDomPointLocation on object class GameInfoStatic");
1227 return true;
1228 }
1229
1230 if ( !(
1231 AdvancedEquals.equalsOrNull(this.getSecondDomPointLocation()
1232 , obj.getSecondDomPointLocation()
1233 )
1234 ) )
1235 {
1236 System.out.println("!!!!!PROPERTY UPDATE ERROR!!!! on property SecondDomPointLocation on object class GameInfoStatic");
1237 return true;
1238 }
1239
1240 if ( !(
1241 AdvancedEquals.equalsOrNull(this.getFactoryLocation()
1242 , obj.getFactoryLocation()
1243 )
1244 ) )
1245 {
1246 System.out.println("!!!!!PROPERTY UPDATE ERROR!!!! on property FactoryLocation on object class GameInfoStatic");
1247 return true;
1248 }
1249
1250 if ( !(this.getFactoryRadius()
1251
1252 == obj.getFactoryRadius()
1253 ) )
1254 {
1255 System.out.println("!!!!!PROPERTY UPDATE ERROR!!!! on property FactoryRadius on object class GameInfoStatic");
1256 return true;
1257 }
1258
1259 if ( !(
1260 AdvancedEquals.equalsOrNull(this.getDisperserLocation()
1261 , obj.getDisperserLocation()
1262 )
1263 ) )
1264 {
1265 System.out.println("!!!!!PROPERTY UPDATE ERROR!!!! on property DisperserLocation on object class GameInfoStatic");
1266 return true;
1267 }
1268
1269 if ( !(this.getDisperserRadius()
1270
1271 == obj.getDisperserRadius()
1272 ) )
1273 {
1274 System.out.println("!!!!!PROPERTY UPDATE ERROR!!!! on property DisperserRadius on object class GameInfoStatic");
1275 return true;
1276 }
1277
1278 if ( !(this.getFactoryAdrenalineCount()
1279
1280 == obj.getFactoryAdrenalineCount()
1281 ) )
1282 {
1283 System.out.println("!!!!!PROPERTY UPDATE ERROR!!!! on property FactoryAdrenalineCount on object class GameInfoStatic");
1284 return true;
1285 }
1286
1287 if ( !(
1288 AdvancedEquals.equalsOrNull(this.getFactorySpawnType()
1289 , obj.getFactorySpawnType()
1290 )
1291 ) )
1292 {
1293 System.out.println("!!!!!PROPERTY UPDATE ERROR!!!! on property FactorySpawnType on object class GameInfoStatic");
1294 return true;
1295 }
1296
1297 }
1298 return false;
1299 }
1300
1301
1302 public String toString() {
1303 return
1304 super.toString() + "[" +
1305
1306 "Gametype = " + String.valueOf(getGametype()
1307 ) + " | " +
1308
1309 "Level = " + String.valueOf(getLevel()
1310 ) + " | " +
1311
1312 "MaxTeams = " + String.valueOf(getMaxTeams()
1313 ) + " | " +
1314
1315 "RedBaseLocation = " + String.valueOf(getRedBaseLocation()
1316 ) + " | " +
1317
1318 "BlueBaseLocation = " + String.valueOf(getBlueBaseLocation()
1319 ) + " | " +
1320
1321 "FirstDomPointLocation = " + String.valueOf(getFirstDomPointLocation()
1322 ) + " | " +
1323
1324 "SecondDomPointLocation = " + String.valueOf(getSecondDomPointLocation()
1325 ) + " | " +
1326
1327 "FactoryLocation = " + String.valueOf(getFactoryLocation()
1328 ) + " | " +
1329
1330 "FactoryRadius = " + String.valueOf(getFactoryRadius()
1331 ) + " | " +
1332
1333 "DisperserLocation = " + String.valueOf(getDisperserLocation()
1334 ) + " | " +
1335
1336 "DisperserRadius = " + String.valueOf(getDisperserRadius()
1337 ) + " | " +
1338
1339 "FactoryAdrenalineCount = " + String.valueOf(getFactoryAdrenalineCount()
1340 ) + " | " +
1341
1342 "FactorySpawnType = " + String.valueOf(getFactorySpawnType()
1343 ) + " | " +
1344
1345 "]";
1346 }
1347
1348
1349 public String toHtmlString() {
1350 return super.toString() + "[<br/>" +
1351
1352 "<b>Gametype</b> = " + String.valueOf(getGametype()
1353 ) + " <br/> " +
1354
1355 "<b>Level</b> = " + String.valueOf(getLevel()
1356 ) + " <br/> " +
1357
1358 "<b>MaxTeams</b> = " + String.valueOf(getMaxTeams()
1359 ) + " <br/> " +
1360
1361 "<b>RedBaseLocation</b> = " + String.valueOf(getRedBaseLocation()
1362 ) + " <br/> " +
1363
1364 "<b>BlueBaseLocation</b> = " + String.valueOf(getBlueBaseLocation()
1365 ) + " <br/> " +
1366
1367 "<b>FirstDomPointLocation</b> = " + String.valueOf(getFirstDomPointLocation()
1368 ) + " <br/> " +
1369
1370 "<b>SecondDomPointLocation</b> = " + String.valueOf(getSecondDomPointLocation()
1371 ) + " <br/> " +
1372
1373 "<b>FactoryLocation</b> = " + String.valueOf(getFactoryLocation()
1374 ) + " <br/> " +
1375
1376 "<b>FactoryRadius</b> = " + String.valueOf(getFactoryRadius()
1377 ) + " <br/> " +
1378
1379 "<b>DisperserLocation</b> = " + String.valueOf(getDisperserLocation()
1380 ) + " <br/> " +
1381
1382 "<b>DisperserRadius</b> = " + String.valueOf(getDisperserRadius()
1383 ) + " <br/> " +
1384
1385 "<b>FactoryAdrenalineCount</b> = " + String.valueOf(getFactoryAdrenalineCount()
1386 ) + " <br/> " +
1387
1388 "<b>FactorySpawnType</b> = " + String.valueOf(getFactorySpawnType()
1389 ) + " <br/> " +
1390
1391 "<br/>]";
1392 }
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403 }
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419 public class GameInfoSharedMessage
1420 extends
1421 GameInfoShared
1422 {
1423
1424
1425
1426 public GameInfoSharedMessage()
1427 {
1428
1429 propertyMap.put(myWeaponStay.getPropertyId(), myWeaponStay);
1430
1431 propertyMap.put(myTimeLimit.getPropertyId(), myTimeLimit);
1432
1433 propertyMap.put(myFragLimit.getPropertyId(), myFragLimit);
1434
1435 propertyMap.put(myGoalTeamScore.getPropertyId(), myGoalTeamScore);
1436
1437 propertyMap.put(myMaxTeamSize.getPropertyId(), myMaxTeamSize);
1438
1439 propertyMap.put(myGamePaused.getPropertyId(), myGamePaused);
1440
1441 propertyMap.put(myBotsPaused.getPropertyId(), myBotsPaused);
1442
1443 }
1444
1445
1446 public UnrealId getId() {
1447 return cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo.GameInfoId;
1448 }
1449
1450 @Override
1451 public
1452 GameInfoSharedMessage clone() {
1453 return this;
1454 }
1455
1456
1457
1458
1459 protected HashMap<PropertyId, ISharedProperty> propertyMap = new HashMap<PropertyId, ISharedProperty>(
1460 7
1461 );
1462
1463 @Override
1464 public ISharedProperty getProperty(PropertyId id) {
1465 return propertyMap.get(id);
1466 }
1467
1468 @Override
1469 public Map<PropertyId, ISharedProperty> getProperties() {
1470 return propertyMap;
1471 }
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481 protected
1482 BooleanProperty
1483 myWeaponStay
1484 = new
1485 BooleanProperty
1486 (
1487 getId(),
1488 "WeaponStay",
1489 WeaponStay,
1490 GameInfo.class
1491 );
1492
1493
1494
1495
1496
1497
1498 public boolean isWeaponStay()
1499 {
1500 return myWeaponStay.getValue();
1501 }
1502
1503
1504
1505
1506
1507
1508
1509
1510 protected
1511 DoubleProperty
1512 myTimeLimit
1513 = new
1514 DoubleProperty
1515 (
1516 getId(),
1517 "TimeLimit",
1518 TimeLimit,
1519 GameInfo.class
1520 );
1521
1522
1523
1524
1525
1526
1527
1528 public double getTimeLimit()
1529 {
1530 return myTimeLimit.getValue();
1531 }
1532
1533
1534
1535
1536
1537
1538
1539 protected
1540 IntProperty
1541 myFragLimit
1542 = new
1543 IntProperty
1544 (
1545 getId(),
1546 "FragLimit",
1547 FragLimit,
1548 GameInfo.class
1549 );
1550
1551
1552
1553
1554
1555
1556 public int getFragLimit()
1557 {
1558 return myFragLimit.getValue();
1559 }
1560
1561
1562
1563
1564
1565
1566
1567
1568 protected
1569 LongProperty
1570 myGoalTeamScore
1571 = new
1572 LongProperty
1573 (
1574 getId(),
1575 "GoalTeamScore",
1576 GoalTeamScore,
1577 GameInfo.class
1578 );
1579
1580
1581
1582
1583
1584
1585
1586 public long getGoalTeamScore()
1587 {
1588 return myGoalTeamScore.getValue();
1589 }
1590
1591
1592
1593
1594
1595
1596
1597
1598 protected
1599 IntProperty
1600 myMaxTeamSize
1601 = new
1602 IntProperty
1603 (
1604 getId(),
1605 "MaxTeamSize",
1606 MaxTeamSize,
1607 GameInfo.class
1608 );
1609
1610
1611
1612
1613
1614
1615
1616 public int getMaxTeamSize()
1617 {
1618 return myMaxTeamSize.getValue();
1619 }
1620
1621
1622
1623
1624
1625
1626
1627 protected
1628 BooleanProperty
1629 myGamePaused
1630 = new
1631 BooleanProperty
1632 (
1633 getId(),
1634 "GamePaused",
1635 GamePaused,
1636 GameInfo.class
1637 );
1638
1639
1640
1641
1642
1643
1644 public boolean isGamePaused()
1645 {
1646 return myGamePaused.getValue();
1647 }
1648
1649
1650
1651
1652
1653
1654
1655
1656 protected
1657 BooleanProperty
1658 myBotsPaused
1659 = new
1660 BooleanProperty
1661 (
1662 getId(),
1663 "BotsPaused",
1664 BotsPaused,
1665 GameInfo.class
1666 );
1667
1668
1669
1670
1671
1672
1673
1674 public boolean isBotsPaused()
1675 {
1676 return myBotsPaused.getValue();
1677 }
1678
1679
1680 public String toString() {
1681 return
1682 super.toString() + "[" +
1683
1684 "WeaponStay = " + String.valueOf(isWeaponStay()
1685 ) + " | " +
1686
1687 "TimeLimit = " + String.valueOf(getTimeLimit()
1688 ) + " | " +
1689
1690 "FragLimit = " + String.valueOf(getFragLimit()
1691 ) + " | " +
1692
1693 "GoalTeamScore = " + String.valueOf(getGoalTeamScore()
1694 ) + " | " +
1695
1696 "MaxTeamSize = " + String.valueOf(getMaxTeamSize()
1697 ) + " | " +
1698
1699 "GamePaused = " + String.valueOf(isGamePaused()
1700 ) + " | " +
1701
1702 "BotsPaused = " + String.valueOf(isBotsPaused()
1703 ) + " | " +
1704
1705 "]";
1706 }
1707
1708
1709 public String toHtmlString() {
1710 return super.toString() + "[<br/>" +
1711
1712 "<b>WeaponStay</b> = " + String.valueOf(isWeaponStay()
1713 ) + " <br/> " +
1714
1715 "<b>TimeLimit</b> = " + String.valueOf(getTimeLimit()
1716 ) + " <br/> " +
1717
1718 "<b>FragLimit</b> = " + String.valueOf(getFragLimit()
1719 ) + " <br/> " +
1720
1721 "<b>GoalTeamScore</b> = " + String.valueOf(getGoalTeamScore()
1722 ) + " <br/> " +
1723
1724 "<b>MaxTeamSize</b> = " + String.valueOf(getMaxTeamSize()
1725 ) + " <br/> " +
1726
1727 "<b>GamePaused</b> = " + String.valueOf(isGamePaused()
1728 ) + " <br/> " +
1729
1730 "<b>BotsPaused</b> = " + String.valueOf(isBotsPaused()
1731 ) + " <br/> " +
1732
1733 "<br/>]";
1734 }
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745 }
1746
1747
1748
1749
1750 @Override
1751 public IWorldObjectUpdateResult<IWorldObject> update(IWorldObject object) {
1752 if (object == null)
1753 {
1754 return new IWorldObjectUpdateResult.WorldObjectUpdateResult(IWorldObjectUpdateResult.Result.CREATED, this);
1755 }
1756 if (!( object instanceof GameInfoMessage) ) {
1757 throw new PogamutException("Can't update different class than GameInfoMessage, got class " + object.getClass().getSimpleName() + "!", this);
1758 }
1759 GameInfoMessage toUpdate = (GameInfoMessage)object;
1760
1761 boolean updated = false;
1762
1763
1764
1765
1766
1767
1768 if (toUpdate.WeaponStay != isWeaponStay()
1769 ) {
1770 toUpdate.WeaponStay=isWeaponStay()
1771 ;
1772 updated = true;
1773 }
1774
1775 if (toUpdate.TimeLimit != getTimeLimit()
1776 ) {
1777 toUpdate.TimeLimit=getTimeLimit()
1778 ;
1779 updated = true;
1780 }
1781
1782 if (toUpdate.FragLimit != getFragLimit()
1783 ) {
1784 toUpdate.FragLimit=getFragLimit()
1785 ;
1786 updated = true;
1787 }
1788
1789 if (toUpdate.GoalTeamScore != getGoalTeamScore()
1790 ) {
1791 toUpdate.GoalTeamScore=getGoalTeamScore()
1792 ;
1793 updated = true;
1794 }
1795
1796 if (toUpdate.MaxTeamSize != getMaxTeamSize()
1797 ) {
1798 toUpdate.MaxTeamSize=getMaxTeamSize()
1799 ;
1800 updated = true;
1801 }
1802
1803 if (toUpdate.GamePaused != isGamePaused()
1804 ) {
1805 toUpdate.GamePaused=isGamePaused()
1806 ;
1807 updated = true;
1808 }
1809
1810 if (toUpdate.BotsPaused != isBotsPaused()
1811 ) {
1812 toUpdate.BotsPaused=isBotsPaused()
1813 ;
1814 updated = true;
1815 }
1816
1817
1818
1819 toUpdate.SimTime = SimTime;
1820
1821 if (updated) {
1822 return new IWorldObjectUpdateResult.WorldObjectUpdateResult<IWorldObject>(IWorldObjectUpdateResult.Result.UPDATED, toUpdate);
1823 } else {
1824 return new IWorldObjectUpdateResult.WorldObjectUpdateResult<IWorldObject>(IWorldObjectUpdateResult.Result.SAME, toUpdate);
1825 }
1826 }
1827
1828 @Override
1829 public ILocalWorldObjectUpdatedEvent getLocalEvent() {
1830 return new GameInfoLocalImpl.GameInfoLocalUpdate
1831 (this.getLocal(), SimTime);
1832 }
1833
1834 @Override
1835 public ISharedWorldObjectUpdatedEvent getSharedEvent() {
1836 return new GameInfoSharedImpl.GameInfoSharedUpdate
1837 (this.getShared(), SimTime, this.getTeamId());
1838 }
1839
1840 @Override
1841 public IStaticWorldObjectUpdatedEvent getStaticEvent() {
1842 return new GameInfoStaticImpl.GameInfoStaticUpdate
1843 (this.getStatic(), SimTime);
1844 }
1845
1846
1847 public String toString() {
1848 return
1849 super.toString() + "[" +
1850
1851 "Gametype = " + String.valueOf(getGametype()
1852 ) + " | " +
1853
1854 "Level = " + String.valueOf(getLevel()
1855 ) + " | " +
1856
1857 "WeaponStay = " + String.valueOf(isWeaponStay()
1858 ) + " | " +
1859
1860 "TimeLimit = " + String.valueOf(getTimeLimit()
1861 ) + " | " +
1862
1863 "FragLimit = " + String.valueOf(getFragLimit()
1864 ) + " | " +
1865
1866 "GoalTeamScore = " + String.valueOf(getGoalTeamScore()
1867 ) + " | " +
1868
1869 "MaxTeams = " + String.valueOf(getMaxTeams()
1870 ) + " | " +
1871
1872 "MaxTeamSize = " + String.valueOf(getMaxTeamSize()
1873 ) + " | " +
1874
1875 "RedBaseLocation = " + String.valueOf(getRedBaseLocation()
1876 ) + " | " +
1877
1878 "BlueBaseLocation = " + String.valueOf(getBlueBaseLocation()
1879 ) + " | " +
1880
1881 "FirstDomPointLocation = " + String.valueOf(getFirstDomPointLocation()
1882 ) + " | " +
1883
1884 "SecondDomPointLocation = " + String.valueOf(getSecondDomPointLocation()
1885 ) + " | " +
1886
1887 "GamePaused = " + String.valueOf(isGamePaused()
1888 ) + " | " +
1889
1890 "BotsPaused = " + String.valueOf(isBotsPaused()
1891 ) + " | " +
1892
1893 "FactoryLocation = " + String.valueOf(getFactoryLocation()
1894 ) + " | " +
1895
1896 "FactoryRadius = " + String.valueOf(getFactoryRadius()
1897 ) + " | " +
1898
1899 "DisperserLocation = " + String.valueOf(getDisperserLocation()
1900 ) + " | " +
1901
1902 "DisperserRadius = " + String.valueOf(getDisperserRadius()
1903 ) + " | " +
1904
1905 "FactoryAdrenalineCount = " + String.valueOf(getFactoryAdrenalineCount()
1906 ) + " | " +
1907
1908 "FactorySpawnType = " + String.valueOf(getFactorySpawnType()
1909 ) + " | " +
1910
1911 "]";
1912 }
1913
1914
1915 public String toHtmlString() {
1916 return super.toString() + "[<br/>" +
1917
1918 "<b>Gametype</b> = " + String.valueOf(getGametype()
1919 ) + " <br/> " +
1920
1921 "<b>Level</b> = " + String.valueOf(getLevel()
1922 ) + " <br/> " +
1923
1924 "<b>WeaponStay</b> = " + String.valueOf(isWeaponStay()
1925 ) + " <br/> " +
1926
1927 "<b>TimeLimit</b> = " + String.valueOf(getTimeLimit()
1928 ) + " <br/> " +
1929
1930 "<b>FragLimit</b> = " + String.valueOf(getFragLimit()
1931 ) + " <br/> " +
1932
1933 "<b>GoalTeamScore</b> = " + String.valueOf(getGoalTeamScore()
1934 ) + " <br/> " +
1935
1936 "<b>MaxTeams</b> = " + String.valueOf(getMaxTeams()
1937 ) + " <br/> " +
1938
1939 "<b>MaxTeamSize</b> = " + String.valueOf(getMaxTeamSize()
1940 ) + " <br/> " +
1941
1942 "<b>RedBaseLocation</b> = " + String.valueOf(getRedBaseLocation()
1943 ) + " <br/> " +
1944
1945 "<b>BlueBaseLocation</b> = " + String.valueOf(getBlueBaseLocation()
1946 ) + " <br/> " +
1947
1948 "<b>FirstDomPointLocation</b> = " + String.valueOf(getFirstDomPointLocation()
1949 ) + " <br/> " +
1950
1951 "<b>SecondDomPointLocation</b> = " + String.valueOf(getSecondDomPointLocation()
1952 ) + " <br/> " +
1953
1954 "<b>GamePaused</b> = " + String.valueOf(isGamePaused()
1955 ) + " <br/> " +
1956
1957 "<b>BotsPaused</b> = " + String.valueOf(isBotsPaused()
1958 ) + " <br/> " +
1959
1960 "<b>FactoryLocation</b> = " + String.valueOf(getFactoryLocation()
1961 ) + " <br/> " +
1962
1963 "<b>FactoryRadius</b> = " + String.valueOf(getFactoryRadius()
1964 ) + " <br/> " +
1965
1966 "<b>DisperserLocation</b> = " + String.valueOf(getDisperserLocation()
1967 ) + " <br/> " +
1968
1969 "<b>DisperserRadius</b> = " + String.valueOf(getDisperserRadius()
1970 ) + " <br/> " +
1971
1972 "<b>FactoryAdrenalineCount</b> = " + String.valueOf(getFactoryAdrenalineCount()
1973 ) + " <br/> " +
1974
1975 "<b>FactorySpawnType</b> = " + String.valueOf(getFactorySpawnType()
1976 ) + " <br/> " +
1977
1978 "<br/>]";
1979 }
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990 }
1991