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 KeyEvent
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
74 public KeyEvent(
75 String Player, UnrealId PlayerId, String PlayerName, UnrealId ViewTarget, String Action, String Key) {
76
77 this.Player = Player;
78
79 this.PlayerId = PlayerId;
80
81 this.PlayerName = PlayerName;
82
83 this.ViewTarget = ViewTarget;
84
85 this.Action = Action;
86
87 this.Key = Key;
88
89 }
90
91
92
93 public static final String PROTOTYPE =
94 "KEYEVENT {Player text} {PlayerId unreal_id} {PlayerName text} {ViewTarget unreal_id} {Action text} {Key text}";
95
96
97
98
99
100
101
102
103 protected
104 String Player =
105 null;
106
107
108
109
110
111
112 public
113 String getPlayer() {
114 return
115 Player;
116 }
117
118
119
120
121
122
123
124 protected
125 UnrealId PlayerId =
126 null;
127
128
129
130
131
132
133 public
134 UnrealId getPlayerId() {
135 return
136 PlayerId;
137 }
138
139
140
141
142
143
144
145 protected
146 String PlayerName =
147 null;
148
149
150
151
152
153
154 public
155 String getPlayerName() {
156 return
157 PlayerName;
158 }
159
160
161
162
163
164
165
166 protected
167 UnrealId ViewTarget =
168 null;
169
170
171
172
173
174
175 public
176 UnrealId getViewTarget() {
177 return
178 ViewTarget;
179 }
180
181
182
183
184
185
186
187 protected
188 String Action =
189 null;
190
191
192
193
194
195
196 public
197 String getAction() {
198 return
199 Action;
200 }
201
202
203
204
205
206
207
208 protected
209 String Key =
210 null;
211
212
213
214
215
216
217 public
218 String getKey() {
219 return
220 Key;
221 }
222
223
224
225
226
227
228
229
230
231 public long getSimTime() {
232
233 return 0;
234 }
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251 public KeyEvent(KeyEvent original) {
252
253 this.Player=original.Player;
254
255 this.PlayerId=original.PlayerId;
256
257 this.PlayerName=original.PlayerName;
258
259 this.ViewTarget=original.ViewTarget;
260
261 this.Action=original.Action;
262
263 this.Key=original.Key;
264
265 }
266
267
268
269
270
271 public KeyEvent() {
272 }
273
274
275
276 public String toString() {
277 return
278
279 super.toString() + " | " +
280
281 "Player = " +
282 String.valueOf(Player) + " | " +
283
284 "PlayerId = " +
285 String.valueOf(PlayerId) + " | " +
286
287 "PlayerName = " +
288 String.valueOf(PlayerName) + " | " +
289
290 "ViewTarget = " +
291 String.valueOf(ViewTarget) + " | " +
292
293 "Action = " +
294 String.valueOf(Action) + " | " +
295
296 "Key = " +
297 String.valueOf(Key) + " | " +
298 "";
299
300 }
301
302 public String toHtmlString() {
303 return super.toString() +
304
305 "<b>Player</b> : " +
306 String.valueOf(Player) +
307 " <br/> " +
308
309 "<b>PlayerId</b> : " +
310 String.valueOf(PlayerId) +
311 " <br/> " +
312
313 "<b>PlayerName</b> : " +
314 String.valueOf(PlayerName) +
315 " <br/> " +
316
317 "<b>ViewTarget</b> : " +
318 String.valueOf(ViewTarget) +
319 " <br/> " +
320
321 "<b>Action</b> : " +
322 String.valueOf(Action) +
323 " <br/> " +
324
325 "<b>Key</b> : " +
326 String.valueOf(Key) +
327 " <br/> " +
328 "";
329 }
330
331
332
333 }
334
335