1
2
3
4
5
6
7
8
9
10
11
12 package cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands;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.*;
13
14
15
16
17
18
19
20
21 public class AddBot
22 extends CommandMessage
23 {
24
25
26
27 public static final String PROTOTYPE =
28 " {Name text} {StartLocation 0,0,0} {StartRotation 0,0,0} {Skill 0} {Team 0} {Type text} ";
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57 public AddBot(
58 String Name, Location StartLocation, Rotation StartRotation, Integer Skill, Integer Team, String Type
59 ) {
60
61 this.Name = Name;
62
63 this.StartLocation = StartLocation;
64
65 this.StartRotation = StartRotation;
66
67 this.Skill = Skill;
68
69 this.Team = Team;
70
71 this.Type = Type;
72
73 }
74
75
76
77
78
79
80
81
82
83
84
85
86
87 public AddBot() {
88 }
89
90
91
92
93
94
95
96 public AddBot(AddBot original) {
97
98 this.Name = original.Name;
99
100 this.StartLocation = original.StartLocation;
101
102 this.StartRotation = original.StartRotation;
103
104 this.Skill = original.Skill;
105
106 this.Team = original.Team;
107
108 this.Type = original.Type;
109
110 }
111
112
113
114
115 protected
116 String Name =
117
118 null
119 ;
120
121
122
123
124
125
126 public String getName()
127
128 {
129 return
130 Name;
131 }
132
133
134
135
136
137
138
139 public AddBot
140 setName(String Name)
141
142 {
143 this.Name = Name;
144 return this;
145 }
146
147
148
149
150
151
152 protected
153 Location StartLocation =
154
155 null
156 ;
157
158
159
160
161
162
163
164
165 public Location getStartLocation()
166
167 {
168 return
169 StartLocation;
170 }
171
172
173
174
175
176
177
178
179
180 public AddBot
181 setStartLocation(Location StartLocation)
182
183 {
184 this.StartLocation = StartLocation;
185 return this;
186 }
187
188
189
190
191
192
193 protected
194 Rotation StartRotation =
195
196 null
197 ;
198
199
200
201
202
203
204
205
206 public Rotation getStartRotation()
207
208 {
209 return
210 StartRotation;
211 }
212
213
214
215
216
217
218
219
220
221 public AddBot
222 setStartRotation(Rotation StartRotation)
223
224 {
225 this.StartRotation = StartRotation;
226 return this;
227 }
228
229
230
231
232
233
234 protected
235 Integer Skill =
236 3;
237
238
239
240
241
242
243
244
245 public Integer getSkill()
246
247 {
248 return
249 Skill;
250 }
251
252
253
254
255
256
257
258
259
260 public AddBot
261 setSkill(Integer Skill)
262
263 {
264 this.Skill = Skill;
265 return this;
266 }
267
268
269
270
271
272
273 protected
274 Integer Team =
275
276 null
277 ;
278
279
280
281
282
283
284
285
286 public Integer getTeam()
287
288 {
289 return
290 Team;
291 }
292
293
294
295
296
297
298
299
300
301 public AddBot
302 setTeam(Integer Team)
303
304 {
305 this.Team = Team;
306 return this;
307 }
308
309
310
311
312
313
314 protected
315 String Type =
316
317 null
318 ;
319
320
321
322
323
324
325
326
327 public String getType()
328
329 {
330 return
331 Type;
332 }
333
334
335
336
337
338
339
340
341
342 public AddBot
343 setType(String Type)
344
345 {
346 this.Type = Type;
347 return this;
348 }
349
350 public String toString() {
351 return toMessage();
352 }
353
354 public String toHtmlString() {
355 return super.toString() + "[<br/>" +
356
357 "<b>Name</b> = " +
358 String.valueOf(getName()
359 ) +
360 " <br/> " +
361
362 "<b>StartLocation</b> = " +
363 String.valueOf(getStartLocation()
364 ) +
365 " <br/> " +
366
367 "<b>StartRotation</b> = " +
368 String.valueOf(getStartRotation()
369 ) +
370 " <br/> " +
371
372 "<b>Skill</b> = " +
373 String.valueOf(getSkill()
374 ) +
375 " <br/> " +
376
377 "<b>Team</b> = " +
378 String.valueOf(getTeam()
379 ) +
380 " <br/> " +
381
382 "<b>Type</b> = " +
383 String.valueOf(getType()
384 ) +
385 " <br/> " +
386
387 "<br/>]"
388 ;
389 }
390
391 public String toMessage() {
392 StringBuffer buf = new StringBuffer();
393 buf.append("ADDBOT");
394
395 if (Name != null) {
396 buf.append(" {Name " + Name + "}");
397 }
398
399 if (StartLocation != null) {
400 buf.append(" {StartLocation " +
401 StartLocation.getX() + "," +
402 StartLocation.getY() + "," +
403 StartLocation.getZ() + "}");
404 }
405
406 if (StartRotation != null) {
407 buf.append(" {StartRotation " +
408 StartRotation.getPitch() + "," +
409 StartRotation.getYaw() + "," +
410 StartRotation.getRoll() + "}");
411 }
412
413 if (Skill != null) {
414 buf.append(" {Skill " + Skill + "}");
415 }
416
417 if (Team != null) {
418 buf.append(" {Team " + Team + "}");
419 }
420
421 if (Type != null) {
422 buf.append(" {Type " + Type + "}");
423 }
424
425 return buf.toString();
426 }
427
428
429
430
431
432 }
433