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 class ObjectSelected
28 extends InfoMessage
29 implements IWorldEvent, IWorldChangeEvent
30
31 {
32
33
34 public static final String PROTOTYPE =
35 "SEL {PlayerId unreal_id} {PlayerName text} {ObjectId unreal_id} {ObjectLocation 0,0,0} {ObjectHitLocation 0,0,0} ";
36
37
38
39
40
41
42 public ObjectSelected()
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 public ObjectSelected(
94 UnrealId PlayerId, String PlayerName, UnrealId ObjectId, Location ObjectLocation, Location ObjectHitLocation
95 ) {
96
97 this.PlayerId = PlayerId;
98
99 this.PlayerName = PlayerName;
100
101 this.ObjectId = ObjectId;
102
103 this.ObjectLocation = ObjectLocation;
104
105 this.ObjectHitLocation = ObjectHitLocation;
106
107 }
108
109
110
111
112
113
114 public ObjectSelected(ObjectSelected original) {
115
116 this.PlayerId = original.getPlayerId()
117 ;
118
119 this.PlayerName = original.getPlayerName()
120 ;
121
122 this.ObjectId = original.getObjectId()
123 ;
124
125 this.ObjectLocation = original.getObjectLocation()
126 ;
127
128 this.ObjectHitLocation = original.getObjectHitLocation()
129 ;
130
131 this.SimTime = original.getSimTime();
132 }
133
134
135 protected long SimTime;
136
137
138
139
140 @Override
141 public long getSimTime() {
142 return SimTime;
143 }
144
145
146
147
148 protected void setSimTime(long SimTime) {
149 this.SimTime = SimTime;
150 }
151
152
153
154
155
156
157
158 protected
159 UnrealId PlayerId =
160 null;
161
162
163
164
165
166
167 public UnrealId getPlayerId()
168 {
169 return PlayerId;
170 }
171
172
173
174
175
176
177
178 protected
179 String PlayerName =
180 null;
181
182
183
184
185
186
187 public String getPlayerName()
188 {
189 return PlayerName;
190 }
191
192
193
194
195
196
197
198
199
200 protected
201 UnrealId ObjectId =
202 null;
203
204
205
206
207
208
209
210
211 public UnrealId getObjectId()
212 {
213 return ObjectId;
214 }
215
216
217
218
219
220
221
222 protected
223 Location ObjectLocation =
224 null;
225
226
227
228
229
230
231 public Location getObjectLocation()
232 {
233 return ObjectLocation;
234 }
235
236
237
238
239
240
241
242 protected
243 Location ObjectHitLocation =
244 null;
245
246
247
248
249
250
251 public Location getObjectHitLocation()
252 {
253 return ObjectHitLocation;
254 }
255
256
257 public String toString() {
258 return
259 super.toString() + "[" +
260
261 "PlayerId = " + String.valueOf(getPlayerId()
262 ) + " | " +
263
264 "PlayerName = " + String.valueOf(getPlayerName()
265 ) + " | " +
266
267 "ObjectId = " + String.valueOf(getObjectId()
268 ) + " | " +
269
270 "ObjectLocation = " + String.valueOf(getObjectLocation()
271 ) + " | " +
272
273 "ObjectHitLocation = " + String.valueOf(getObjectHitLocation()
274 ) + " | " +
275
276 "]";
277 }
278
279
280 public String toHtmlString() {
281 return super.toString() + "[<br/>" +
282
283 "<b>PlayerId</b> = " + String.valueOf(getPlayerId()
284 ) + " <br/> " +
285
286 "<b>PlayerName</b> = " + String.valueOf(getPlayerName()
287 ) + " <br/> " +
288
289 "<b>ObjectId</b> = " + String.valueOf(getObjectId()
290 ) + " <br/> " +
291
292 "<b>ObjectLocation</b> = " + String.valueOf(getObjectLocation()
293 ) + " <br/> " +
294
295 "<b>ObjectHitLocation</b> = " + String.valueOf(getObjectHitLocation()
296 ) + " <br/> " +
297
298 "<br/>]";
299 }
300
301 public String toJsonLiteral() {
302 return "ObjectSelected(null, "
303
304 + ")";
305 }
306
307
308
309
310
311
312
313
314
315
316 }
317