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 abstract class VehicleShared
31 extends InfoMessage
32 implements ISharedWorldObject
33
34 ,ILocated
35 ,ILocomotive
36 ,IRotable
37 {
38
39
40
41
42
43
44 public VehicleShared()
45 {
46 }
47
48
49
50
51 protected long SimTime;
52
53
54
55
56 @Override
57 public long getSimTime() {
58 return SimTime;
59 }
60
61
62
63
64 protected void setSimTime(long SimTime) {
65 this.SimTime = SimTime;
66 }
67
68 public static final Token RotationPropertyToken = Tokens.get("Rotation");
69
70 public static final Token LocationPropertyToken = Tokens.get("Location");
71
72 public static final Token VelocityPropertyToken = Tokens.get("Velocity");
73
74 public static final Token TeamPropertyToken = Tokens.get("Team");
75
76 public static final Token HealthPropertyToken = Tokens.get("Health");
77
78 public static final Token ArmorPropertyToken = Tokens.get("Armor");
79
80 public static final Token DriverPropertyToken = Tokens.get("Driver");
81
82 public static final Token TeamLockedPropertyToken = Tokens.get("TeamLocked");
83
84
85 public static final Set<Token> SharedPropertyTokens;
86
87 static {
88 Set<Token> tokens = new HashSet<Token>();
89
90 tokens.add(RotationPropertyToken);
91
92 tokens.add(LocationPropertyToken);
93
94 tokens.add(VelocityPropertyToken);
95
96 tokens.add(TeamPropertyToken);
97
98 tokens.add(HealthPropertyToken);
99
100 tokens.add(ArmorPropertyToken);
101
102 tokens.add(DriverPropertyToken);
103
104 tokens.add(TeamLockedPropertyToken);
105
106 SharedPropertyTokens = Collections.unmodifiableSet(tokens);
107 }
108
109
110 @Override
111 public abstract
112 VehicleShared clone();
113
114 @Override
115 public Class getCompositeClass() {
116 return Vehicle.class;
117 }
118
119
120
121
122
123
124 public abstract UnrealId getId()
125 ;
126
127
128
129
130
131
132 public abstract Rotation getRotation()
133 ;
134
135
136
137
138
139
140 public abstract Location getLocation()
141 ;
142
143
144
145
146
147
148
149 public abstract Velocity getVelocity()
150 ;
151
152
153
154
155
156
157
158 public abstract Integer getTeam()
159 ;
160
161
162
163
164
165
166 public abstract Integer getHealth()
167 ;
168
169
170
171
172
173
174 public abstract Integer getArmor()
175 ;
176
177
178
179
180 public abstract UnrealId getDriver()
181 ;
182
183
184
185
186
187
188 public abstract boolean isTeamLocked()
189 ;
190
191
192 public String toString() {
193 return
194 super.toString() + "[" +
195
196 "Id = " + String.valueOf(getId()
197 ) + " | " +
198
199 "Rotation = " + String.valueOf(getRotation()
200 ) + " | " +
201
202 "Location = " + String.valueOf(getLocation()
203 ) + " | " +
204
205 "Velocity = " + String.valueOf(getVelocity()
206 ) + " | " +
207
208 "Team = " + String.valueOf(getTeam()
209 ) + " | " +
210
211 "Health = " + String.valueOf(getHealth()
212 ) + " | " +
213
214 "Armor = " + String.valueOf(getArmor()
215 ) + " | " +
216
217 "Driver = " + String.valueOf(getDriver()
218 ) + " | " +
219
220 "TeamLocked = " + String.valueOf(isTeamLocked()
221 ) + " | " +
222
223 "]";
224 }
225
226
227 public String toHtmlString() {
228 return super.toString() + "[<br/>" +
229
230 "<b>Id</b> = " + String.valueOf(getId()
231 ) + " <br/> " +
232
233 "<b>Rotation</b> = " + String.valueOf(getRotation()
234 ) + " <br/> " +
235
236 "<b>Location</b> = " + String.valueOf(getLocation()
237 ) + " <br/> " +
238
239 "<b>Velocity</b> = " + String.valueOf(getVelocity()
240 ) + " <br/> " +
241
242 "<b>Team</b> = " + String.valueOf(getTeam()
243 ) + " <br/> " +
244
245 "<b>Health</b> = " + String.valueOf(getHealth()
246 ) + " <br/> " +
247
248 "<b>Armor</b> = " + String.valueOf(getArmor()
249 ) + " <br/> " +
250
251 "<b>Driver</b> = " + String.valueOf(getDriver()
252 ) + " <br/> " +
253
254 "<b>TeamLocked</b> = " + String.valueOf(isTeamLocked()
255 ) + " <br/> " +
256
257 "<br/>]";
258 }
259
260
261
262
263
264
265
266
267
268
269 }
270