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