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