1
2
3
4
5
6
7
8
9
10 package
11 cz.cuni.amis.pogamut.udk.communication.messages.gbcommands;
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 AddBot extends
44 CommandMessage
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 public AddBot(
70 String Name, Location StartLocation, Rotation StartRotation, int Skill, String Type) {
71
72 this.Name = Name;
73
74 this.StartLocation = StartLocation;
75
76 this.StartRotation = StartRotation;
77
78 this.Skill = Skill;
79
80 this.Type = Type;
81
82 }
83
84
85
86
87
88
89
90
91
92
93
94 public AddBot() {
95 }
96
97
98
99
100
101
102 protected
103 String Name =
104 null;
105
106
107
108
109 public
110 String getName() {
111 return
112 Name;
113 }
114
115
116
117
118
119 public AddBot setName(String Name) {
120 this.Name = Name;
121 return this;
122 }
123
124
125
126
127
128 protected
129 Location StartLocation =
130 null;
131
132
133
134
135
136
137 public
138 Location getStartLocation() {
139 return
140 StartLocation;
141 }
142
143
144
145
146
147
148
149 public AddBot setStartLocation(Location StartLocation) {
150 this.StartLocation = StartLocation;
151 return this;
152 }
153
154
155
156
157
158 protected
159 Rotation StartRotation =
160 null;
161
162
163
164
165
166
167 public
168 Rotation getStartRotation() {
169 return
170 StartRotation;
171 }
172
173
174
175
176
177
178
179 public AddBot setStartRotation(Rotation StartRotation) {
180 this.StartRotation = StartRotation;
181 return this;
182 }
183
184
185
186
187
188 protected
189 int Skill =
190 3;
191
192
193
194
195
196
197 public
198 int getSkill() {
199 return
200 Skill;
201 }
202
203
204
205
206
207
208
209 public AddBot setSkill(int Skill) {
210 this.Skill = Skill;
211 return this;
212 }
213
214
215
216
217
218 protected
219 String Type =
220 null;
221
222
223
224
225
226
227 public
228 String getType() {
229 return
230 Type;
231 }
232
233
234
235
236
237
238
239 public AddBot setType(String Type) {
240 this.Type = Type;
241 return this;
242 }
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265 public AddBot(AddBot original) {
266
267 this.Name=original.Name;
268
269 this.StartLocation=original.StartLocation;
270
271 this.StartRotation=original.StartRotation;
272
273 this.Skill=original.Skill;
274
275 this.Type=original.Type;
276
277 }
278
279
280
281
282 public String toString() {
283 return
284
285 toMessage();
286
287 }
288
289 public String toHtmlString() {
290 return super.toString() +
291
292 "<b>Name</b> : " +
293 String.valueOf(Name) +
294 " <br/> " +
295
296 "<b>StartLocation</b> : " +
297 String.valueOf(StartLocation) +
298 " <br/> " +
299
300 "<b>StartRotation</b> : " +
301 String.valueOf(StartRotation) +
302 " <br/> " +
303
304 "<b>Skill</b> : " +
305 String.valueOf(Skill) +
306 " <br/> " +
307
308 "<b>Type</b> : " +
309 String.valueOf(Type) +
310 " <br/> " +
311 "";
312 }
313
314
315
316 public String toMessage() {
317 StringBuffer buf = new StringBuffer();
318 buf.append("ADDBOT");
319
320 if (Name != null) {
321 buf.append(" {Name " + Name + "}");
322 }
323
324 if (StartLocation != null) {
325 buf.append(" {StartLocation " +
326 StartLocation.getX() + "," +
327 StartLocation.getY() + "," +
328 StartLocation.getZ() + "}");
329 }
330
331 if (StartRotation != null) {
332 buf.append(" {StartRotation " +
333 StartRotation.getPitch() + "," +
334 StartRotation.getYaw() + "," +
335 StartRotation.getRoll() + "}");
336 }
337
338 buf.append(" {Skill " + Skill + "}");
339
340 if (Type != null) {
341 buf.append(" {Type " + Type + "}");
342 }
343
344 return buf.toString();
345 }
346
347 }
348
349