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