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 public class SendMessage
21 extends CommandMessage
22 {
23
24
25
26 public static final String PROTOTYPE =
27 " {Id unreal_id} {Text text} {TeamIndex 0} {Global False} {FadeOut 0} ";
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49 public SendMessage(
50 UnrealId Id, String Text, Integer TeamIndex, Boolean Global, Double FadeOut
51 ) {
52
53 this.Id = Id;
54
55 this.Text = Text;
56
57 this.TeamIndex = TeamIndex;
58
59 this.Global = Global;
60
61 this.FadeOut = FadeOut;
62
63 }
64
65
66
67
68
69
70
71
72
73
74
75
76 public SendMessage() {
77 }
78
79
80
81
82
83
84
85 public SendMessage(SendMessage original) {
86
87 this.Id = original.Id;
88
89 this.Text = original.Text;
90
91 this.TeamIndex = original.TeamIndex;
92
93 this.Global = original.Global;
94
95 this.FadeOut = original.FadeOut;
96
97 }
98
99
100
101
102 protected
103 UnrealId Id =
104
105 null
106 ;
107
108
109
110
111
112
113 public UnrealId getId()
114
115 {
116 return
117 Id;
118 }
119
120
121
122
123
124
125
126 public SendMessage
127 setId(UnrealId Id)
128
129 {
130 this.Id = Id;
131 return this;
132 }
133
134
135
136
137 protected
138 String Text =
139
140 null
141 ;
142
143
144
145
146
147
148 public String getText()
149
150 {
151 return
152 Text;
153 }
154
155
156
157
158
159
160
161 public SendMessage
162 setText(String Text)
163
164 {
165 this.Text = Text;
166 return this;
167 }
168
169
170
171
172
173
174 protected
175 Integer TeamIndex =
176
177 null
178 ;
179
180
181
182
183
184
185
186
187 public Integer getTeamIndex()
188
189 {
190 return
191 TeamIndex;
192 }
193
194
195
196
197
198
199
200
201
202 public SendMessage
203 setTeamIndex(Integer TeamIndex)
204
205 {
206 this.TeamIndex = TeamIndex;
207 return this;
208 }
209
210
211
212
213
214
215
216 protected
217 Boolean Global =
218
219 null
220 ;
221
222
223
224
225
226
227
228
229
230 public Boolean isGlobal()
231
232 {
233 return
234 Global;
235 }
236
237
238
239
240
241
242
243
244
245
246 public SendMessage
247 setGlobal(Boolean Global)
248
249 {
250 this.Global = Global;
251 return this;
252 }
253
254
255
256
257 protected
258 Double FadeOut =
259
260 null
261 ;
262
263
264
265
266
267
268 public Double getFadeOut()
269
270 {
271 return
272 FadeOut;
273 }
274
275
276
277
278
279
280
281 public SendMessage
282 setFadeOut(Double FadeOut)
283
284 {
285 this.FadeOut = FadeOut;
286 return this;
287 }
288
289 public String toString() {
290 return toMessage();
291 }
292
293 public String toHtmlString() {
294 return super.toString() + "[<br/>" +
295
296 "<b>Id</b> = " +
297 String.valueOf(getId()
298 ) +
299 " <br/> " +
300
301 "<b>Text</b> = " +
302 String.valueOf(getText()
303 ) +
304 " <br/> " +
305
306 "<b>TeamIndex</b> = " +
307 String.valueOf(getTeamIndex()
308 ) +
309 " <br/> " +
310
311 "<b>Global</b> = " +
312 String.valueOf(isGlobal()
313 ) +
314 " <br/> " +
315
316 "<b>FadeOut</b> = " +
317 String.valueOf(getFadeOut()
318 ) +
319 " <br/> " +
320
321 "<br/>]"
322 ;
323 }
324
325 public String toMessage() {
326 StringBuffer buf = new StringBuffer();
327 buf.append("MESSAGE");
328
329 if (Id != null) {
330 buf.append(" {Id " + Id.getStringId() + "}");
331 }
332
333 if (Text != null) {
334 buf.append(" {Text " + Text + "}");
335 }
336
337 if (TeamIndex != null) {
338 buf.append(" {TeamIndex " + TeamIndex + "}");
339 }
340
341 if (Global != null) {
342 buf.append(" {Global " + Global + "}");
343 }
344
345 if (FadeOut != null) {
346 buf.append(" {FadeOut " + FadeOut + "}");
347 }
348
349 return buf.toString();
350 }
351
352
353
354
355
356 }
357