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