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