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