1 package cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages;
2
3 // --- IMPORTS FROM /messages/settings/javasettings/javaimport BEGIN
4 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.*;
5 // --- IMPORTS FROM /messages/settings/javasettings/javaimport END
6
7
8 // --- IMPORTS FROM extra/code/java/javapart/classcategory[@name='all'] BEGIN
9
10 // --- IMPORTS FROM extra/code/java/javapart/classcategory[@name='all'] END
11
12 // --- IMPORTS FROM extra/code/java/javapart/classcategory[@name=composite]+classtype[@name=impl] BEGIN
13
14 // --- IMPORTS FROM extra/code/java/javapart/classcategory[@name=composite]+classtype[@name=impl] END
15
16 /**
17 *
18 Composite implementation of the CONFCH abstract message. It wraps Local/Shared/Static parts in single object
19 allowing to presenting a nice facade for users.
20
21 *
22 * <p></p><p></p>
23 * Complete message documentation:
24 *
25 Asynchronous message. Message sent when the bot configuration
26 changed - each agent has a lot of parameters affecting his state
27 in the environment. See each property for the details.
28
29 */
30 public class ConfigChangeCompositeImpl
31 extends ConfigChange
32 {
33
34
35
36 /**
37 * Parameter-less contructor for the message.
38 */
39 public ConfigChangeCompositeImpl()
40 {
41 }
42
43
44 /**
45 * Composite-impl constructor. It assembles the message from its three fragments - local/shared/static.
46 *
47 * @param partLocal local-part of the message
48 * @param partShared shared-part of the message
49 * @param partStatic static-part of the message
50 */
51 public ConfigChangeCompositeImpl(
52 ConfigChangeLocalImpl partLocal,
53 ConfigChangeSharedImpl partShared,
54 ConfigChangeStaticImpl partStatic
55 ) {
56 this.partLocal = partLocal;
57 this.partShared = partShared;
58 this.partStatic = partStatic;
59 }
60
61 /**
62 * Cloning constructor.
63 *
64 * @param original
65 */
66 public ConfigChangeCompositeImpl(ConfigChangeCompositeImpl original) {
67 this.partLocal = partLocal;
68 this.partShared = partShared;
69 this.partStatic = partStatic;
70 }
71
72
73 @Override
74 public void setSimTime(long SimTime) {
75 super.setSimTime(SimTime);
76 }
77
78
79 protected
80 ConfigChangeStaticImpl
81 partStatic;
82
83 @Override
84 public ConfigChangeStatic getStatic() {
85 return partStatic;
86 }
87
88 protected
89 ConfigChangeLocalImpl
90 partLocal;
91
92 @Override
93 public ConfigChangeLocal getLocal() {
94 return partLocal;
95 }
96
97 ConfigChangeSharedImpl
98 partShared;
99
100 @Override
101 public ConfigChangeShared getShared() {
102 return partShared;
103 }
104
105
106
107 @Override
108
109 /**
110 * Id of this config message. This Id is generated from BotId, string "_CONFCH" is added at the end.
111 */
112 public UnrealId getId()
113 {
114 return
115
116 partStatic.
117 getId()
118 ;
119 }
120
121 @Override
122
123 /**
124 * Unique Id of the bot.
125 */
126 public UnrealId getBotId()
127 {
128 return
129
130 partLocal.
131 getBotId()
132 ;
133 }
134
135 @Override
136
137 /**
138 *
139 True if we have to spawn the bot manually after each death
140
141 */
142 public boolean isManualSpawn()
143 {
144 return
145
146 partLocal.
147 isManualSpawn()
148 ;
149 }
150
151 @Override
152
153 /**
154 *
155 True if the bot is using auto ray tracing (is provided with
156 synchronous ATR messages). See ATR messages for more
157 details.
158
159 */
160 public boolean isAutoTrace()
161 {
162 return
163
164 partLocal.
165 isAutoTrace()
166 ;
167 }
168
169 @Override
170
171 /**
172 * The bot's name.
173 */
174 public String getName()
175 {
176 return
177
178 partLocal.
179 getName()
180 ;
181 }
182
183 @Override
184
185 /**
186 *
187 Bots default speed will be multiplied by this number. Ranges from 0.1 to 2 (default, can be set in ini in [GameBots2004.RemoteBot] MaxSpeed).
188
189 */
190 public double getSpeedMultiplier()
191 {
192 return
193
194 partLocal.
195 getSpeedMultiplier()
196 ;
197 }
198
199 @Override
200
201 /**
202 *
203 Bot rotation rate. Default rotation rate is: (Pitch=3072,Yaw=60000,Roll=2048) and may be configured in ini file in [GameBots2004.RemoteBot] DefaultRotationRate. (pitch - up/down, yaw - left/right, roll - equivalent of doing a cartwheel)
204
205 */
206 public Rotation getRotationRate()
207 {
208 return
209
210 partLocal.
211 getRotationRate()
212 ;
213 }
214
215 @Override
216
217 /**
218 *
219 If bot is invulnerable (cannot die) or not.
220
221 */
222 public boolean isInvulnerable()
223 {
224 return
225
226 partLocal.
227 isInvulnerable()
228 ;
229 }
230
231 @Override
232
233 /**
234 *
235 The delay between two self message synchronous batches
236 (can range from 0.01 to 2 seconds). Will be used only if NewSelfBatchProtocol
237 attribute is set to true in INIT message.
238
239 */
240 public double getSelfUpdateTime()
241 {
242 return
243
244 partLocal.
245 getSelfUpdateTime()
246 ;
247 }
248
249 @Override
250
251 /**
252 *
253 The delay between two synchronous batches containing vision updates
254 (can range from 0.1 to 2 seconds). If NewSelfBatchProtocol
255 attribute is set to true in INIT message, more batch messages containing only
256 SELF message will arrive between two vision update batches (containing PLR,PRJ,INV.. messages).
257
258 */
259 public double getVisionTime()
260 {
261 return
262
263 partLocal.
264 getVisionTime()
265 ;
266 }
267
268 @Override
269
270 /**
271 *
272 Holds information how many times faster is exported location update message (UPD) compared to sync. batch, e.g. when this multiplier is set to 5 and vision time is 250 ms, UPD message will arrive every 50 ms.
273
274 */
275 public int getLocUpdateMultiplier()
276 {
277 return
278
279 partLocal.
280 getLocUpdateMultiplier()
281 ;
282 }
283
284 @Override
285
286 /**
287 *
288 If some additional debug information will be shown in the
289 UT2004 server console window.
290
291 */
292 public boolean isShowDebug()
293 {
294 return
295
296 partLocal.
297 isShowDebug()
298 ;
299 }
300
301 @Override
302
303 /**
304 *
305 If true an actor visualizing the location the bot is
306 actually looking at will appear in the game.
307
308 */
309 public boolean isShowFocalPoint()
310 {
311 return
312
313 partLocal.
314 isShowFocalPoint()
315 ;
316 }
317
318 @Override
319
320 /**
321 *
322 if the GB should draw lines representing the auto ray traces
323 of the bot (for more information see ATR message).
324
325 */
326 public boolean isDrawTraceLines()
327 {
328 return
329
330 partLocal.
331 isDrawTraceLines()
332 ;
333 }
334
335 @Override
336
337 /**
338 *
339 It informs if sending of all GB synchronous messages is
340 enabled or disabled.
341
342 */
343 public boolean isSynchronousOff()
344 {
345 return
346
347 partLocal.
348 isSynchronousOff()
349 ;
350 }
351
352 @Override
353
354 /**
355 *
356 It enables/disables automatic pickup of the bot. If true the items can be picked up through PICK command.
357
358 */
359 public boolean isAutoPickupOff()
360 {
361 return
362
363 partLocal.
364 isAutoPickupOff()
365 ;
366 }
367
368 @Override
369
370 /**
371 *
372 Name of current BDI action.
373
374 */
375 public String getAction()
376 {
377 return
378
379 partLocal.
380 getAction()
381 ;
382 }
383
384
385 public String toString() {
386 return
387 super.toString() + "[" +
388
389 "Static = " + String.valueOf(partStatic) + " | Local = " + String.valueOf(partLocal) + " | Shared = " + String.valueOf(partShared) + " ]" +
390
391 "]";
392 }
393
394
395 public String toHtmlString() {
396 return super.toString() + "[<br/>" +
397
398 "Static = " + String.valueOf(partStatic) + " <br/> Local = " + String.valueOf(partLocal) + " <br/> Shared = " + String.valueOf(partShared) + " ]" +
399
400 "<br/>]";
401 }
402
403
404 // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=all]) ---
405
406 // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=all]) ---
407
408 // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=composite+classtype[@name=impl]) ---
409
410 // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=composite+classtype[@name=impl]) ---
411
412 }
413