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