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
43 public class
44 Initialize extends
45 CommandMessage
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 public Initialize(
101 String Name, int Team, boolean ManualSpawn, boolean AutoTrace, Location Location, Rotation Rotation, String Skin, int DesiredSkill, boolean ShouldLeadTarget, boolean AutoPickupOff, String Jmx, String ClassName) {
102
103 this.Name = Name;
104
105 this.Team = Team;
106
107 this.ManualSpawn = ManualSpawn;
108
109 this.AutoTrace = AutoTrace;
110
111 this.Location = Location;
112
113 this.Rotation = Rotation;
114
115 this.Skin = Skin;
116
117 this.DesiredSkill = DesiredSkill;
118
119 this.ShouldLeadTarget = ShouldLeadTarget;
120
121 this.AutoPickupOff = AutoPickupOff;
122
123 this.Jmx = Jmx;
124
125 this.ClassName = ClassName;
126
127 }
128
129
130
131
132
133
134
135
136
137
138
139
140 public Initialize() {
141 }
142
143
144
145
146
147
148 protected
149 String Name =
150 null;
151
152
153
154
155 public
156 String getName() {
157 return
158 Name;
159 }
160
161
162
163
164
165 public Initialize setName(String Name) {
166 this.Name = Name;
167 return this;
168 }
169
170
171
172
173
174
175
176 protected
177 int Team =
178 0;
179
180
181
182
183
184
185
186
187 public
188 int getTeam() {
189 return
190 Team;
191 }
192
193
194
195
196
197
198
199
200
201 public Initialize setTeam(int Team) {
202 this.Team = Team;
203 return this;
204 }
205
206
207
208
209
210
211
212 protected
213 boolean ManualSpawn =
214 false;
215
216
217
218
219
220
221
222
223 public
224 boolean isManualSpawn() {
225 return
226 ManualSpawn;
227 }
228
229
230
231
232
233
234
235
236
237 public Initialize setManualSpawn(boolean ManualSpawn) {
238 this.ManualSpawn = ManualSpawn;
239 return this;
240 }
241
242
243
244
245
246 protected
247 boolean AutoTrace =
248 false;
249
250
251
252
253
254
255 public
256 boolean isAutoTrace() {
257 return
258 AutoTrace;
259 }
260
261
262
263
264
265
266
267 public Initialize setAutoTrace(boolean AutoTrace) {
268 this.AutoTrace = AutoTrace;
269 return this;
270 }
271
272
273
274
275
276 protected
277 Location Location =
278 null;
279
280
281
282
283
284
285 public
286 Location getLocation() {
287 return
288 Location;
289 }
290
291
292
293
294
295
296
297 public Initialize setLocation(Location Location) {
298 this.Location = Location;
299 return this;
300 }
301
302
303
304
305
306 protected
307 Rotation Rotation =
308 null;
309
310
311
312
313
314
315 public
316 Rotation getRotation() {
317 return
318 Rotation;
319 }
320
321
322
323
324
325
326
327 public Initialize setRotation(Rotation Rotation) {
328 this.Rotation = Rotation;
329 return this;
330 }
331
332
333
334
335
336
337 protected
338 String Skin =
339 null;
340
341
342
343
344
345
346
347 public
348 String getSkin() {
349 return
350 Skin;
351 }
352
353
354
355
356
357
358
359
360 public Initialize setSkin(String Skin) {
361 this.Skin = Skin;
362 return this;
363 }
364
365
366
367
368
369
370 protected
371 int DesiredSkill =
372 0;
373
374
375
376
377
378
379
380 public
381 int getDesiredSkill() {
382 return
383 DesiredSkill;
384 }
385
386
387
388
389
390
391
392
393 public Initialize setDesiredSkill(int DesiredSkill) {
394 this.DesiredSkill = DesiredSkill;
395 return this;
396 }
397
398
399
400
401
402
403
404 protected
405 boolean ShouldLeadTarget =
406 false;
407
408
409
410
411
412
413
414
415 public
416 boolean isShouldLeadTarget() {
417 return
418 ShouldLeadTarget;
419 }
420
421
422
423
424
425
426
427
428
429 public Initialize setShouldLeadTarget(boolean ShouldLeadTarget) {
430 this.ShouldLeadTarget = ShouldLeadTarget;
431 return this;
432 }
433
434
435
436
437
438 protected
439 boolean AutoPickupOff =
440 false;
441
442
443
444
445
446
447 public
448 boolean isAutoPickupOff() {
449 return
450 AutoPickupOff;
451 }
452
453
454
455
456
457
458
459 public Initialize setAutoPickupOff(boolean AutoPickupOff) {
460 this.AutoPickupOff = AutoPickupOff;
461 return this;
462 }
463
464
465
466
467
468 protected
469 String Jmx =
470 null;
471
472
473
474
475
476
477 public
478 String getJmx() {
479 return
480 Jmx;
481 }
482
483
484
485
486
487
488
489 public Initialize setJmx(String Jmx) {
490 this.Jmx = Jmx;
491 return this;
492 }
493
494
495
496
497
498 protected
499 String ClassName =
500 null;
501
502
503
504
505
506
507 public
508 String getClassName() {
509 return
510 ClassName;
511 }
512
513
514
515
516
517
518
519 public Initialize setClassName(String ClassName) {
520 this.ClassName = ClassName;
521 return this;
522 }
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545 public Initialize(Initialize original) {
546
547 this.Name=original.Name;
548
549 this.Team=original.Team;
550
551 this.ManualSpawn=original.ManualSpawn;
552
553 this.AutoTrace=original.AutoTrace;
554
555 this.Location=original.Location;
556
557 this.Rotation=original.Rotation;
558
559 this.Skin=original.Skin;
560
561 this.DesiredSkill=original.DesiredSkill;
562
563 this.ShouldLeadTarget=original.ShouldLeadTarget;
564
565 this.AutoPickupOff=original.AutoPickupOff;
566
567 this.Jmx=original.Jmx;
568
569 this.ClassName=original.ClassName;
570
571 }
572
573
574
575
576 public String toString() {
577 return
578
579 toMessage();
580
581 }
582
583 public String toHtmlString() {
584 return super.toString() +
585
586 "<b>Name</b> : " +
587 String.valueOf(Name) +
588 " <br/> " +
589
590 "<b>Team</b> : " +
591 String.valueOf(Team) +
592 " <br/> " +
593
594 "<b>ManualSpawn</b> : " +
595 String.valueOf(ManualSpawn) +
596 " <br/> " +
597
598 "<b>AutoTrace</b> : " +
599 String.valueOf(AutoTrace) +
600 " <br/> " +
601
602 "<b>Location</b> : " +
603 String.valueOf(Location) +
604 " <br/> " +
605
606 "<b>Rotation</b> : " +
607 String.valueOf(Rotation) +
608 " <br/> " +
609
610 "<b>Skin</b> : " +
611 String.valueOf(Skin) +
612 " <br/> " +
613
614 "<b>DesiredSkill</b> : " +
615 String.valueOf(DesiredSkill) +
616 " <br/> " +
617
618 "<b>ShouldLeadTarget</b> : " +
619 String.valueOf(ShouldLeadTarget) +
620 " <br/> " +
621
622 "<b>AutoPickupOff</b> : " +
623 String.valueOf(AutoPickupOff) +
624 " <br/> " +
625
626 "<b>Jmx</b> : " +
627 String.valueOf(Jmx) +
628 " <br/> " +
629
630 "<b>ClassName</b> : " +
631 String.valueOf(ClassName) +
632 " <br/> " +
633 "";
634 }
635
636
637
638 public String toMessage() {
639 StringBuffer buf = new StringBuffer();
640 buf.append("INIT");
641
642 if (Name != null) {
643 buf.append(" {Name " + Name + "}");
644 }
645
646 buf.append(" {Team " + Team + "}");
647
648 buf.append(" {ManualSpawn " + ManualSpawn + "}");
649
650 buf.append(" {AutoTrace " + AutoTrace + "}");
651
652 if (Location != null) {
653 buf.append(" {Location " +
654 Location.getX() + "," +
655 Location.getY() + "," +
656 Location.getZ() + "}");
657 }
658
659 if (Rotation != null) {
660 buf.append(" {Rotation " +
661 Rotation.getPitch() + "," +
662 Rotation.getYaw() + "," +
663 Rotation.getRoll() + "}");
664 }
665
666 if (Skin != null) {
667 buf.append(" {Skin " + Skin + "}");
668 }
669
670 buf.append(" {DesiredSkill " + DesiredSkill + "}");
671
672 buf.append(" {ShouldLeadTarget " + ShouldLeadTarget + "}");
673
674 buf.append(" {AutoPickupOff " + AutoPickupOff + "}");
675
676 if (Jmx != null) {
677 buf.append(" {Jmx " + Jmx + "}");
678 }
679
680 if (ClassName != null) {
681 buf.append(" {ClassName " + ClassName + "}");
682 }
683
684 return buf.toString();
685 }
686
687 }
688
689