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
43 public class
44 ChangedWeapon
45 extends GBEvent
46
47 implements IWorldEvent, IWorldChangeEvent
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 ChangedWeapon(
75 String Id, int PrimaryAmmo, int SecondaryAmmo, String Type) {
76
77 this.Id = Id;
78
79 this.PrimaryAmmo = PrimaryAmmo;
80
81 this.SecondaryAmmo = SecondaryAmmo;
82
83 this.Type = Type;
84
85 }
86
87
88
89 public static final String PROTOTYPE =
90 "CWP {Id text} {PrimaryAmmo 0} {SecondaryAmmo 0} {Type text}";
91
92
93
94
95
96
97
98
99
100
101 protected
102 String Id =
103 null;
104
105
106
107
108
109
110
111
112 public
113 String getId() {
114 return
115 Id;
116 }
117
118
119
120
121
122
123
124 protected
125 int PrimaryAmmo =
126 0;
127
128
129
130
131
132
133 public
134 int getPrimaryAmmo() {
135 return
136 PrimaryAmmo;
137 }
138
139
140
141
142
143
144
145 protected
146 int SecondaryAmmo =
147 0;
148
149
150
151
152
153
154 public
155 int getSecondaryAmmo() {
156 return
157 SecondaryAmmo;
158 }
159
160
161
162
163
164
165
166 protected
167 String Type =
168 null;
169
170
171
172
173
174
175 public
176 String getType() {
177 return
178 Type;
179 }
180
181
182
183
184
185
186
187
188
189 public long getSimTime() {
190
191 return 0;
192 }
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209 public ChangedWeapon(ChangedWeapon original) {
210
211 this.Id=original.Id;
212
213 this.PrimaryAmmo=original.PrimaryAmmo;
214
215 this.SecondaryAmmo=original.SecondaryAmmo;
216
217 this.Type=original.Type;
218
219 }
220
221
222
223
224
225 public ChangedWeapon() {
226 }
227
228
229
230 public String toString() {
231 return
232
233 super.toString() + " | " +
234
235 "Id = " +
236 String.valueOf(Id) + " | " +
237
238 "PrimaryAmmo = " +
239 String.valueOf(PrimaryAmmo) + " | " +
240
241 "SecondaryAmmo = " +
242 String.valueOf(SecondaryAmmo) + " | " +
243
244 "Type = " +
245 String.valueOf(Type) + " | " +
246 "";
247
248 }
249
250 public String toHtmlString() {
251 return super.toString() +
252
253 "<b>Id</b> : " +
254 String.valueOf(Id) +
255 " <br/> " +
256
257 "<b>PrimaryAmmo</b> : " +
258 String.valueOf(PrimaryAmmo) +
259 " <br/> " +
260
261 "<b>SecondaryAmmo</b> : " +
262 String.valueOf(SecondaryAmmo) +
263 " <br/> " +
264
265 "<b>Type</b> : " +
266 String.valueOf(Type) +
267 " <br/> " +
268 "";
269 }
270
271
272
273 }
274
275