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