1
2
3
4
5
6
7
8
9
10 package
11 cz.cuni.amis.pogamut.udk.communication.messages.gbinfomessages;
12 import java.util.*;
13 import javax.vecmath.*;
14 import cz.cuni.amis.pogamut.base.communication.messages.*;
15 import cz.cuni.amis.pogamut.base.communication.worldview.*;
16 import cz.cuni.amis.pogamut.base.communication.worldview.event.*;
17 import cz.cuni.amis.pogamut.base.communication.worldview.object.*;
18 import cz.cuni.amis.pogamut.base.communication.translator.event.*;
19 import cz.cuni.amis.pogamut.base3d.worldview.object.*;
20 import cz.cuni.amis.pogamut.base3d.worldview.object.event.*;
21 import cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId;
22 import cz.cuni.amis.pogamut.udk.communication.messages.*;
23 import cz.cuni.amis.pogamut.udk.communication.worldview.objects.*;
24 import cz.cuni.amis.pogamut.udk.communication.translator.itemdescriptor.*;
25 import cz.cuni.amis.pogamut.udk.communication.messages.ItemType.Category;
26 import cz.cuni.amis.utils.exception.*;
27 import cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result;
28 import cz.cuni.amis.utils.SafeEquals;
29 import cz.cuni.amis.pogamut.multi.communication.worldview.object.*;
30
31
32
33
34
35
36
37
38
39
40
41 public class
42 ObjectSelected
43 extends GBEvent
44
45 implements IWorldEvent, IWorldChangeEvent
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 public ObjectSelected(
74 UnrealId PlayerId, String PlayerName, UnrealId ObjectId, Location ObjectLocation, Location ObjectHitLocation) {
75
76 this.PlayerId = PlayerId;
77
78 this.PlayerName = PlayerName;
79
80 this.ObjectId = ObjectId;
81
82 this.ObjectLocation = ObjectLocation;
83
84 this.ObjectHitLocation = ObjectHitLocation;
85
86 }
87
88
89
90 public static final String PROTOTYPE =
91 "SEL {PlayerId unreal_id} {PlayerName text} {ObjectId unreal_id} {ObjectLocation 0,0,0} {ObjectHitLocation 0,0,0}";
92
93
94
95
96
97
98
99
100 protected
101 UnrealId PlayerId =
102 null;
103
104
105
106
107
108
109 public
110 UnrealId getPlayerId() {
111 return
112 PlayerId;
113 }
114
115
116
117
118
119
120
121 protected
122 String PlayerName =
123 null;
124
125
126
127
128
129
130 public
131 String getPlayerName() {
132 return
133 PlayerName;
134 }
135
136
137
138
139
140
141
142
143
144 protected
145 UnrealId ObjectId =
146 null;
147
148
149
150
151
152
153
154
155 public
156 UnrealId getObjectId() {
157 return
158 ObjectId;
159 }
160
161
162
163
164
165
166
167 protected
168 Location ObjectLocation =
169 null;
170
171
172
173
174
175
176 public
177 Location getObjectLocation() {
178 return
179 ObjectLocation;
180 }
181
182
183
184
185
186
187
188 protected
189 Location ObjectHitLocation =
190 null;
191
192
193
194
195
196
197 public
198 Location getObjectHitLocation() {
199 return
200 ObjectHitLocation;
201 }
202
203
204
205
206
207
208
209
210
211 public long getSimTime() {
212
213 return 0;
214 }
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231 public ObjectSelected(ObjectSelected original) {
232
233 this.PlayerId=original.PlayerId;
234
235 this.PlayerName=original.PlayerName;
236
237 this.ObjectId=original.ObjectId;
238
239 this.ObjectLocation=original.ObjectLocation;
240
241 this.ObjectHitLocation=original.ObjectHitLocation;
242
243 }
244
245
246
247
248
249 public ObjectSelected() {
250 }
251
252
253
254 public String toString() {
255 return
256
257 super.toString() + " | " +
258
259 "PlayerId = " +
260 String.valueOf(PlayerId) + " | " +
261
262 "PlayerName = " +
263 String.valueOf(PlayerName) + " | " +
264
265 "ObjectId = " +
266 String.valueOf(ObjectId) + " | " +
267
268 "ObjectLocation = " +
269 String.valueOf(ObjectLocation) + " | " +
270
271 "ObjectHitLocation = " +
272 String.valueOf(ObjectHitLocation) + " | " +
273 "";
274
275 }
276
277 public String toHtmlString() {
278 return super.toString() +
279
280 "<b>PlayerId</b> : " +
281 String.valueOf(PlayerId) +
282 " <br/> " +
283
284 "<b>PlayerName</b> : " +
285 String.valueOf(PlayerName) +
286 " <br/> " +
287
288 "<b>ObjectId</b> : " +
289 String.valueOf(ObjectId) +
290 " <br/> " +
291
292 "<b>ObjectLocation</b> : " +
293 String.valueOf(ObjectLocation) +
294 " <br/> " +
295
296 "<b>ObjectHitLocation</b> : " +
297 String.valueOf(ObjectHitLocation) +
298 " <br/> " +
299 "";
300 }
301
302
303
304 }
305
306