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