1
2 /**
3 IMPORTANT !!!
4
5 DO NOT EDIT THIS FILE. IT IS GENERATED FROM approriate xml file in xmlresources/gbcommands BY
6 THE JavaClassesGenerator.xslt. MODIFY THAT FILE INSTEAD OF THIS ONE.
7
8 Use Ant task process-gb-messages after that to generate .java files again.
9
10 IMPORTANT END !!!
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 * Representation of the GameBots2004 command CHECKREACH.
15 *
16 *
17 Check to see if you can move directly to a destination without
18 hitting an obstruction, falling in a pit, etc. Responding with
19 RCH message.
20
21 */
22 public class CheckReachability
23 extends CommandMessage
24 {
25
26
27 /** Example how the message looks like - used during parser tests. */
28 public static final String PROTOTYPE =
29 " {Id text} {Target unreal_id} {Location 0,0,0} ";
30
31 /**
32 * Creates new instance of command CheckReachability.
33 *
34 Check to see if you can move directly to a destination without
35 hitting an obstruction, falling in a pit, etc. Responding with
36 RCH message.
37
38 * Corresponding GameBots message for this command is
39 * CHECKREACH.
40 *
41 *
42 * @param Id
43 Message Id made up by you and echoed in response so you can
44 match up response with query.
45
46 * @param Target
47 The unique Id of a player/object/nav point/whatever.
48
49 * @param Location
50 Location you want to go to. Normal location rules. Only used
51 if no Target is sent.
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 * Creates new instance of command CheckReachability.
69 *
70 Check to see if you can move directly to a destination without
71 hitting an obstruction, falling in a pit, etc. Responding with
72 RCH message.
73
74 * Corresponding GameBots message for this command is
75 * CHECKREACH.
76 * <p></p>
77 * WARNING: this is empty-command constructor, you have to use setters to fill it up with data that should be sent to GameBots2004!
78 */
79 public CheckReachability() {
80 }
81
82
83 /**
84 * Cloning constructor.
85 *
86 * @param original
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 Message Id made up by you and echoed in response so you can
101 match up response with query.
102
103 */
104 protected
105 String Id =
106
107 null
108 ;
109
110
111
112 /**
113 *
114 Message Id made up by you and echoed in response so you can
115 match up response with query.
116
117 */
118 public String getId()
119
120 {
121 return
122 Id;
123 }
124
125
126
127
128 /**
129 *
130 Message Id made up by you and echoed in response so you can
131 match up response with query.
132
133 */
134 public CheckReachability
135 setId(String Id)
136
137 {
138 this.Id = Id;
139 return this;
140 }
141
142 /**
143
144 The unique Id of a player/object/nav point/whatever.
145
146 */
147 protected
148 UnrealId Target =
149
150 null
151 ;
152
153
154
155 /**
156 *
157 The unique Id of a player/object/nav point/whatever.
158
159 */
160 public UnrealId getTarget()
161
162 {
163 return
164 Target;
165 }
166
167
168
169
170 /**
171 *
172 The unique Id of a player/object/nav point/whatever.
173
174 */
175 public CheckReachability
176 setTarget(UnrealId Target)
177
178 {
179 this.Target = Target;
180 return this;
181 }
182
183 /**
184
185 Location you want to go to. Normal location rules. Only used
186 if no Target is sent.
187
188 */
189 protected
190 Location Location =
191
192 null
193 ;
194
195
196
197 /**
198 *
199 Location you want to go to. Normal location rules. Only used
200 if no Target is sent.
201
202 */
203 public Location getLocation()
204
205 {
206 return
207 Location;
208 }
209
210
211
212
213 /**
214 *
215 Location you want to go to. Normal location rules. Only used
216 if no Target is sent.
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 // --- Extra Java from XML BEGIN (extra/code/java)
276
277 // --- Extra Java from XML END (extra/code/java)
278
279 }
280