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 THESE FILES INSTEAD OF THIS ONE.
7
8 IMPORTANT END !!!
9 */
10 package
11 cz.cuni.amis.pogamut.udk.communication.messages.gbcommands;
12 import java.util.*;
13 import javax.vecmath.*;
14 import cz.cuni.amis.pogamut.base.communication.messages.*;
15 import cz.cuni.amis.pogamut.base.communication.worldview.*;
16 import cz.cuni.amis.pogamut.base.communication.worldview.event.*;
17 import cz.cuni.amis.pogamut.base.communication.worldview.object.*;
18 import cz.cuni.amis.pogamut.base.communication.translator.event.*;
19 import cz.cuni.amis.pogamut.base3d.worldview.object.*;
20 import cz.cuni.amis.pogamut.base3d.worldview.object.event.*;
21 import cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId;
22 import cz.cuni.amis.pogamut.udk.communication.messages.*;
23 import cz.cuni.amis.pogamut.udk.communication.worldview.objects.*;
24 import cz.cuni.amis.pogamut.udk.communication.translator.itemdescriptor.*;
25 import cz.cuni.amis.pogamut.udk.communication.messages.ItemType.Category;
26 import cz.cuni.amis.utils.exception.*;
27 import cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result;
28 import cz.cuni.amis.utils.SafeEquals;
29 import cz.cuni.amis.pogamut.multi.communication.worldview.object.*;
30
31
32 /**
33
34 Start firing your weapon (until receives STOPSHOOT command, or
35 run out of ammo or die).
36
37 Corresponding GameBots command is
38 SHOOT.
39
40 */
41
42 public class
43 Shoot extends
44 CommandMessage
45
46 {
47
48 /**
49 Creates new instance of command Shoot.
50
51 Start firing your weapon (until receives STOPSHOOT command, or
52 run out of ammo or die).
53 Corresponding GameBots message for this command is
54 SHOOT.
55 @param Location Location you want to shoot at.
56 @param Target
57 The unique Id of your target. If you specify a target, and
58 it is visible to you, the server will provide aim correction
59 and target leading for you. If not you just shoot at the
60 location specified.
61
62 @param Alt
63 If you send True to this you will alt fire instead of normal
64 fire. For normal fire you don't need to send this argument
65 at all.
66
67 */
68 public Shoot(
69 Location Location, UnrealId Target, boolean Alt) {
70
71 this.Location = Location;
72
73 this.Target = Target;
74
75 this.Alt = Alt;
76
77 }
78
79
80 /**
81 Creates new instance of command Shoot.
82
83 Start firing your weapon (until receives STOPSHOOT command, or
84 run out of ammo or die).
85 Corresponding GameBots message for this command is
86 SHOOT.
87 <p></p>WARNING: this is empty-command constructor, you have to use setters to fill it up!
88 */
89 public Shoot() {
90 }
91
92
93 /////// Properties BEGIN
94
95 /**
96 Location you want to shoot at. */
97 protected
98 Location Location =
99 null;
100
101
102 /**
103 Location you want to shoot at. */
104 public
105 Location getLocation() {
106 return
107 Location;
108 }
109
110
111
112 /**
113 Location you want to shoot at. */
114 public Shoot setLocation(Location Location) {
115 this.Location = Location;
116 return this;
117 }
118
119 /**
120
121 The unique Id of your target. If you specify a target, and
122 it is visible to you, the server will provide aim correction
123 and target leading for you. If not you just shoot at the
124 location specified.
125 */
126 protected
127 UnrealId Target =
128 null;
129
130
131 /**
132
133 The unique Id of your target. If you specify a target, and
134 it is visible to you, the server will provide aim correction
135 and target leading for you. If not you just shoot at the
136 location specified.
137 */
138 public
139 UnrealId getTarget() {
140 return
141 Target;
142 }
143
144
145
146 /**
147
148 The unique Id of your target. If you specify a target, and
149 it is visible to you, the server will provide aim correction
150 and target leading for you. If not you just shoot at the
151 location specified.
152 */
153 public Shoot setTarget(UnrealId Target) {
154 this.Target = Target;
155 return this;
156 }
157
158 /**
159
160 If you send True to this you will alt fire instead of normal
161 fire. For normal fire you don't need to send this argument
162 at all.
163 */
164 protected
165 boolean Alt =
166 false;
167
168
169 /**
170
171 If you send True to this you will alt fire instead of normal
172 fire. For normal fire you don't need to send this argument
173 at all.
174 */
175 public
176 boolean isAlt() {
177 return
178 Alt;
179 }
180
181
182
183 /**
184
185 If you send True to this you will alt fire instead of normal
186 fire. For normal fire you don't need to send this argument
187 at all.
188 */
189 public Shoot setAlt(boolean Alt) {
190 this.Alt = Alt;
191 return this;
192 }
193
194 /////// Properties END
195
196 /////// Extra Java code BEGIN
197
198 /////// Additional code from xslt BEGIN
199
200
201
202 /////// Additional code from xslt END
203
204 /////// Extra Java from XML BEGIN
205
206 /////// Extra Java from XML END
207
208 /////// Extra Java code END
209
210
211
212 /**
213 * Cloning constructor.
214 */
215 public Shoot(Shoot original) {
216
217 this.Location=original.Location;
218
219 this.Target=original.Target;
220
221 this.Alt=original.Alt;
222
223 }
224
225
226
227
228 public String toString() {
229 return
230
231 toMessage();
232
233 }
234
235 public String toHtmlString() {
236 return super.toString() +
237
238 "<b>Location</b> : " +
239 String.valueOf(Location) +
240 " <br/> " +
241
242 "<b>Target</b> : " +
243 String.valueOf(Target) +
244 " <br/> " +
245
246 "<b>Alt</b> : " +
247 String.valueOf(Alt) +
248 " <br/> " +
249 "";
250 }
251
252
253
254 public String toMessage() {
255 StringBuffer buf = new StringBuffer();
256 buf.append("SHOOT");
257
258 if (Location != null) {
259 buf.append(" {Location " +
260 Location.getX() + "," +
261 Location.getY() + "," +
262 Location.getZ() + "}");
263 }
264
265 if (Target != null) {
266 buf.append(" {Target " + Target.getStringId() + "}");
267 }
268
269 buf.append(" {Alt " + Alt + "}");
270
271 return buf.toString();
272 }
273
274 }
275
276