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 public abstract class EntityShared
28 extends InfoMessage
29 implements ISharedWorldObject
30
31 ,ILocated
32 {
33
34
35
36
37
38
39 public EntityShared()
40 {
41 }
42
43
44
45
46 protected long SimTime;
47
48
49
50
51 @Override
52 public long getSimTime() {
53 return SimTime;
54 }
55
56
57
58
59 protected void setSimTime(long SimTime) {
60 this.SimTime = SimTime;
61 }
62
63 public static final Token LocationPropertyToken = Tokens.get("Location");
64
65 public static final Token RotationPropertyToken = Tokens.get("Rotation");
66
67 public static final Token VelocityPropertyToken = Tokens.get("Velocity");
68
69
70 public static final Set<Token> SharedPropertyTokens;
71
72 static {
73 Set<Token> tokens = new HashSet<Token>();
74
75 tokens.add(LocationPropertyToken);
76
77 tokens.add(RotationPropertyToken);
78
79 tokens.add(VelocityPropertyToken);
80
81 SharedPropertyTokens = Collections.unmodifiableSet(tokens);
82 }
83
84
85 @Override
86 public abstract
87 EntityShared clone();
88
89 @Override
90 public Class getCompositeClass() {
91 return Entity.class;
92 }
93
94
95
96
97
98
99
100
101 public abstract UnrealId getId()
102 ;
103
104
105
106
107 public abstract Location getLocation()
108 ;
109
110
111
112
113 public abstract Rotation getRotation()
114 ;
115
116
117
118
119 public abstract Velocity getVelocity()
120 ;
121
122
123 public String toString() {
124 return
125 super.toString() + "[" +
126
127 "Id = " + String.valueOf(getId()
128 ) + " | " +
129
130 "Location = " + String.valueOf(getLocation()
131 ) + " | " +
132
133 "Rotation = " + String.valueOf(getRotation()
134 ) + " | " +
135
136 "Velocity = " + String.valueOf(getVelocity()
137 ) + " | " +
138
139 "]";
140 }
141
142
143 public String toHtmlString() {
144 return super.toString() + "[<br/>" +
145
146 "<b>Id</b> = " + String.valueOf(getId()
147 ) + " <br/> " +
148
149 "<b>Location</b> = " + String.valueOf(getLocation()
150 ) + " <br/> " +
151
152 "<b>Rotation</b> = " + String.valueOf(getRotation()
153 ) + " <br/> " +
154
155 "<b>Velocity</b> = " + String.valueOf(getVelocity()
156 ) + " <br/> " +
157
158 "<br/>]";
159 }
160
161
162
163
164
165
166
167
168
169
170 }
171