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
42 public class
43 ItemPickedUp
44 extends GBEvent
45
46 implements IWorldEvent, IWorldChangeEvent, ILocated
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 public ItemPickedUp(
85 UnrealId Id, UnrealId InventoryId, Location Location, int Amount, int AmountSec, ItemType Type, ItemDescriptor Descriptor, Boolean Dropped) {
86
87 this.Id = Id;
88
89 this.InventoryId = InventoryId;
90
91 this.Location = Location;
92
93 this.Amount = Amount;
94
95 this.AmountSec = AmountSec;
96
97 this.Type = Type;
98
99 this.Descriptor = Descriptor;
100
101 this.Dropped = Dropped;
102
103 }
104
105
106
107 public static final String PROTOTYPE =
108 "IPK {Id unreal_id} {InventoryId unreal_id} {Location 0,0,0} {Amount 0} {AmountSec 0} {Type xWeapons.FlakCannonPickup} {Dropped False}";
109
110
111
112
113
114
115
116
117
118 protected
119 UnrealId Id =
120 null;
121
122
123
124
125
126
127
128 public
129 UnrealId getId() {
130 return
131 Id;
132 }
133
134
135
136
137
138
139
140
141
142 protected
143 UnrealId InventoryId =
144 null;
145
146
147
148
149
150
151
152
153 public
154 UnrealId getInventoryId() {
155 return
156 InventoryId;
157 }
158
159
160
161
162
163 protected
164 Location Location =
165 null;
166
167
168
169
170 public
171 Location getLocation() {
172 return
173 Location;
174 }
175
176
177
178
179
180
181
182
183 protected
184 int Amount =
185 0;
186
187
188
189
190
191
192
193 public
194 int getAmount() {
195 return
196 Amount;
197 }
198
199
200
201
202
203
204
205 protected
206 int AmountSec =
207 0;
208
209
210
211
212
213
214 public
215 int getAmountSec() {
216 return
217 AmountSec;
218 }
219
220
221
222
223
224
225
226 protected
227 ItemType Type =
228 null;
229
230
231
232
233
234
235 public
236 ItemType getType() {
237 return
238 Type;
239 }
240
241
242
243
244
245
246
247 protected
248 ItemDescriptor Descriptor =
249 null;
250
251
252
253
254
255
256 public
257 ItemDescriptor getDescriptor() {
258 return
259 Descriptor;
260 }
261
262
263
264
265
266
267
268 protected
269 Boolean Dropped =
270 null;
271
272
273
274
275
276
277 public
278 Boolean isDropped() {
279 return
280 Dropped;
281 }
282
283
284
285
286
287
288
289
290
291 public long getSimTime() {
292
293 return 0;
294 }
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311 public ItemPickedUp(ItemPickedUp original) {
312
313 this.Id=original.Id;
314
315 this.InventoryId=original.InventoryId;
316
317 this.Location=original.Location;
318
319 this.Amount=original.Amount;
320
321 this.AmountSec=original.AmountSec;
322
323 this.Type=original.Type;
324
325 this.Descriptor=original.Descriptor;
326
327 this.Dropped=original.Dropped;
328
329 }
330
331
332
333
334
335 public ItemPickedUp() {
336 }
337
338
339
340 public String toString() {
341 return
342
343 super.toString() + " | " +
344
345 "Id = " +
346 String.valueOf(Id) + " | " +
347
348 "InventoryId = " +
349 String.valueOf(InventoryId) + " | " +
350
351 "Location = " +
352 String.valueOf(Location) + " | " +
353
354 "Amount = " +
355 String.valueOf(Amount) + " | " +
356
357 "AmountSec = " +
358 String.valueOf(AmountSec) + " | " +
359
360 "Type = " +
361 String.valueOf(Type) + " | " +
362
363 "Dropped = " +
364 String.valueOf(Dropped) + " | " +
365 "";
366
367 }
368
369 public String toHtmlString() {
370 return super.toString() +
371
372 "<b>Id</b> : " +
373 String.valueOf(Id) +
374 " <br/> " +
375
376 "<b>InventoryId</b> : " +
377 String.valueOf(InventoryId) +
378 " <br/> " +
379
380 "<b>Location</b> : " +
381 String.valueOf(Location) +
382 " <br/> " +
383
384 "<b>Amount</b> : " +
385 String.valueOf(Amount) +
386 " <br/> " +
387
388 "<b>AmountSec</b> : " +
389 String.valueOf(AmountSec) +
390 " <br/> " +
391
392 "<b>Type</b> : " +
393 String.valueOf(Type) +
394 " <br/> " +
395
396 "<b>Descriptor</b> : " +
397 String.valueOf(Descriptor) +
398 " <br/> " +
399
400 "<b>Dropped</b> : " +
401 String.valueOf(Dropped) +
402 " <br/> " +
403 "";
404 }
405
406
407
408 }
409
410