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
22 public class ChangeTeam
23 extends CommandMessage
24 {
25
26
27
28 public static final String PROTOTYPE =
29 " {Id unreal_id} {Team 0} ";
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51 public ChangeTeam(
52 UnrealId Id, Integer Team
53 ) {
54
55 this.Id = Id;
56
57 this.Team = Team;
58
59 }
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74 public ChangeTeam() {
75 }
76
77
78
79
80
81
82
83 public ChangeTeam(ChangeTeam original) {
84
85 this.Id = original.Id;
86
87 this.Team = original.Team;
88
89 }
90
91
92
93
94
95
96
97 protected
98 UnrealId Id =
99
100 null
101 ;
102
103
104
105
106
107
108
109
110
111 public UnrealId getId()
112
113 {
114 return
115 Id;
116 }
117
118
119
120
121
122
123
124
125
126
127 public ChangeTeam
128 setId(UnrealId Id)
129
130 {
131 this.Id = Id;
132 return this;
133 }
134
135
136
137
138
139
140
141 protected
142 Integer Team =
143
144 null
145 ;
146
147
148
149
150
151
152
153
154
155 public Integer getTeam()
156
157 {
158 return
159 Team;
160 }
161
162
163
164
165
166
167
168
169
170
171 public ChangeTeam
172 setTeam(Integer Team)
173
174 {
175 this.Team = Team;
176 return this;
177 }
178
179 public String toString() {
180 return toMessage();
181 }
182
183 public String toHtmlString() {
184 return super.toString() + "[<br/>" +
185
186 "<b>Id</b> = " +
187 String.valueOf(getId()
188 ) +
189 " <br/> " +
190
191 "<b>Team</b> = " +
192 String.valueOf(getTeam()
193 ) +
194 " <br/> " +
195
196 "<br/>]"
197 ;
198 }
199
200 public String toMessage() {
201 StringBuffer buf = new StringBuffer();
202 buf.append("CHANGETEAM");
203
204 if (Id != null) {
205 buf.append(" {Id " + Id.getStringId() + "}");
206 }
207
208 if (Team != null) {
209 buf.append(" {Team " + Team + "}");
210 }
211
212 return buf.toString();
213 }
214
215
216
217
218
219 }
220