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 TURNTO.
15 *
16 *
17 Specify a point, rotation value or object to turn towards.
18
19 */
20 public class TurnTo
21 extends CommandMessage
22 {
23
24
25 /** Example how the message looks like - used during parser tests. */
26 public static final String PROTOTYPE =
27 " {Target unreal_id} {Rotation 0,0,0} {Location 0,0,0} ";
28
29 /**
30 * Creates new instance of command TurnTo.
31 *
32 Specify a point, rotation value or object to turn towards.
33
34 * Corresponding GameBots message for this command is
35 * TURNTO.
36 *
37 *
38 * @param Target
39 The unique id of a player/object/nav point/whatever that you
40 want to face. Must be visible.
41
42 * @param Rotation
43 Absolute rotation you want to spin to. Must be provided as comma
44 delimited ("0,50000,0") and should be in absolute terms and
45 in UT units (2pi = 65535 units). Used only if no target
46 provided. Rotation is parsed: First pitch (up, down), then yaw (left, right), the roll (no effect here, however it is an equivalent of doing a cartwheel).
47
48 * @param Location
49 Location you want to face. Normal rules for location. Only
50 used if no Target or Rotation.
51
52 */
53 public TurnTo(
54 UnrealId Target, Rotation Rotation, Location Location
55 ) {
56
57 this.Target = Target;
58
59 this.Rotation = Rotation;
60
61 this.Location = Location;
62
63 }
64
65
66 /**
67 * Creates new instance of command TurnTo.
68 *
69 Specify a point, rotation value or object to turn towards.
70
71 * Corresponding GameBots message for this command is
72 * TURNTO.
73 * <p></p>
74 * WARNING: this is empty-command constructor, you have to use setters to fill it up with data that should be sent to GameBots2004!
75 */
76 public TurnTo() {
77 }
78
79
80 /**
81 * Cloning constructor.
82 *
83 * @param original
84 */
85 public TurnTo(TurnTo original) {
86
87 this.Target = original.Target;
88
89 this.Rotation = original.Rotation;
90
91 this.Location = original.Location;
92
93 }
94
95 /**
96
97 The unique id of a player/object/nav point/whatever that you
98 want to face. Must be visible.
99
100 */
101 protected
102 UnrealId Target =
103
104 null
105 ;
106
107
108
109 /**
110 *
111 The unique id of a player/object/nav point/whatever that you
112 want to face. Must be visible.
113
114 */
115 public UnrealId getTarget()
116
117 {
118 return
119 Target;
120 }
121
122
123
124
125 /**
126 *
127 The unique id of a player/object/nav point/whatever that you
128 want to face. Must be visible.
129
130 */
131 public TurnTo
132 setTarget(UnrealId Target)
133
134 {
135 this.Target = Target;
136 return this;
137 }
138
139 /**
140
141 Absolute rotation you want to spin to. Must be provided as comma
142 delimited ("0,50000,0") and should be in absolute terms and
143 in UT units (2pi = 65535 units). Used only if no target
144 provided. Rotation is parsed: First pitch (up, down), then yaw (left, right), the roll (no effect here, however it is an equivalent of doing a cartwheel).
145
146 */
147 protected
148 Rotation Rotation =
149
150 null
151 ;
152
153
154
155 /**
156 *
157 Absolute rotation you want to spin to. Must be provided as comma
158 delimited ("0,50000,0") and should be in absolute terms and
159 in UT units (2pi = 65535 units). Used only if no target
160 provided. Rotation is parsed: First pitch (up, down), then yaw (left, right), the roll (no effect here, however it is an equivalent of doing a cartwheel).
161
162 */
163 public Rotation getRotation()
164
165 {
166 return
167 Rotation;
168 }
169
170
171
172
173 /**
174 *
175 Absolute rotation you want to spin to. Must be provided as comma
176 delimited ("0,50000,0") and should be in absolute terms and
177 in UT units (2pi = 65535 units). Used only if no target
178 provided. Rotation is parsed: First pitch (up, down), then yaw (left, right), the roll (no effect here, however it is an equivalent of doing a cartwheel).
179
180 */
181 public TurnTo
182 setRotation(Rotation Rotation)
183
184 {
185 this.Rotation = Rotation;
186 return this;
187 }
188
189 /**
190
191 Location you want to face. Normal rules for location. Only
192 used if no Target or Rotation.
193
194 */
195 protected
196 Location Location =
197
198 null
199 ;
200
201
202
203 /**
204 *
205 Location you want to face. Normal rules for location. Only
206 used if no Target or Rotation.
207
208 */
209 public Location getLocation()
210
211 {
212 return
213 Location;
214 }
215
216
217
218
219 /**
220 *
221 Location you want to face. Normal rules for location. Only
222 used if no Target or Rotation.
223
224 */
225 public TurnTo
226 setLocation(Location Location)
227
228 {
229 this.Location = Location;
230 return this;
231 }
232
233 public String toString() {
234 return toMessage();
235 }
236
237 public String toHtmlString() {
238 return super.toString() + "[<br/>" +
239
240 "<b>Target</b> = " +
241 String.valueOf(getTarget()
242 ) +
243 " <br/> " +
244
245 "<b>Rotation</b> = " +
246 String.valueOf(getRotation()
247 ) +
248 " <br/> " +
249
250 "<b>Location</b> = " +
251 String.valueOf(getLocation()
252 ) +
253 " <br/> " +
254
255 "<br/>]"
256 ;
257 }
258
259 public String toMessage() {
260 StringBuffer buf = new StringBuffer();
261 buf.append("TURNTO");
262
263 if (Target != null) {
264 buf.append(" {Target " + Target.getStringId() + "}");
265 }
266
267 if (Rotation != null) {
268 buf.append(" {Rotation " +
269 Rotation.getPitch() + "," +
270 Rotation.getYaw() + "," +
271 Rotation.getRoll() + "}");
272 }
273
274 if (Location != null) {
275 buf.append(" {Location " +
276 Location.getX() + "," +
277 Location.getY() + "," +
278 Location.getZ() + "}");
279 }
280
281 return buf.toString();
282 }
283
284 // --- Extra Java from XML BEGIN (extra/code/java)
285
286 // --- Extra Java from XML END (extra/code/java)
287
288 }
289