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
43
44 public class
45 SpawnActor extends
46 CommandMessage
47
48 {
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68 public SpawnActor(
69 Location Location, Rotation Rotation, String Type) {
70
71 this.Location = Location;
72
73 this.Rotation = Rotation;
74
75 this.Type = Type;
76
77 }
78
79
80
81
82
83
84
85
86
87
88
89
90
91 public SpawnActor() {
92 }
93
94
95
96
97
98
99
100
101 protected
102 Location Location =
103 null;
104
105
106
107
108
109
110 public
111 Location getLocation() {
112 return
113 Location;
114 }
115
116
117
118
119
120
121
122 public SpawnActor setLocation(Location Location) {
123 this.Location = Location;
124 return this;
125 }
126
127
128
129 protected
130 Rotation Rotation =
131 null;
132
133
134
135
136 public
137 Rotation getRotation() {
138 return
139 Rotation;
140 }
141
142
143
144
145
146 public SpawnActor setRotation(Rotation Rotation) {
147 this.Rotation = Rotation;
148 return this;
149 }
150
151
152
153
154
155
156 protected
157 String Type =
158 null;
159
160
161
162
163
164
165
166 public
167 String getType() {
168 return
169 Type;
170 }
171
172
173
174
175
176
177
178
179 public SpawnActor setType(String Type) {
180 this.Type = Type;
181 return this;
182 }
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205 public SpawnActor(SpawnActor original) {
206
207 this.Location=original.Location;
208
209 this.Rotation=original.Rotation;
210
211 this.Type=original.Type;
212
213 }
214
215
216
217
218 public String toString() {
219 return
220
221 toMessage();
222
223 }
224
225 public String toHtmlString() {
226 return super.toString() +
227
228 "<b>Location</b> : " +
229 String.valueOf(Location) +
230 " <br/> " +
231
232 "<b>Rotation</b> : " +
233 String.valueOf(Rotation) +
234 " <br/> " +
235
236 "<b>Type</b> : " +
237 String.valueOf(Type) +
238 " <br/> " +
239 "";
240 }
241
242
243
244 public String toMessage() {
245 StringBuffer buf = new StringBuffer();
246 buf.append("SPAWNACTOR");
247
248 if (Location != null) {
249 buf.append(" {Location " +
250 Location.getX() + "," +
251 Location.getY() + "," +
252 Location.getZ() + "}");
253 }
254
255 if (Rotation != null) {
256 buf.append(" {Rotation " +
257 Rotation.getPitch() + "," +
258 Rotation.getYaw() + "," +
259 Rotation.getRoll() + "}");
260 }
261
262 if (Type != null) {
263 buf.append(" {Type " + Type + "}");
264 }
265
266 return buf.toString();
267 }
268
269 }
270
271