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