1
2
3
4
5
6
7
8
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
35
36
37
38
39
40
41
42 public class
43 Shoot extends
44 CommandMessage
45
46 {
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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
82
83
84
85
86
87
88
89 public Shoot() {
90 }
91
92
93
94
95
96
97 protected
98 Location Location =
99 null;
100
101
102
103
104 public
105 Location getLocation() {
106 return
107 Location;
108 }
109
110
111
112
113
114 public Shoot setLocation(Location Location) {
115 this.Location = Location;
116 return this;
117 }
118
119
120
121
122
123
124
125
126 protected
127 UnrealId Target =
128 null;
129
130
131
132
133
134
135
136
137
138 public
139 UnrealId getTarget() {
140 return
141 Target;
142 }
143
144
145
146
147
148
149
150
151
152
153 public Shoot setTarget(UnrealId Target) {
154 this.Target = Target;
155 return this;
156 }
157
158
159
160
161
162
163
164 protected
165 boolean Alt =
166 false;
167
168
169
170
171
172
173
174
175 public
176 boolean isAlt() {
177 return
178 Alt;
179 }
180
181
182
183
184
185
186
187
188
189 public Shoot setAlt(boolean Alt) {
190 this.Alt = Alt;
191 return this;
192 }
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
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