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 synchronous batches (can range from
236 0.1 to 2 seconds).
237
238 */
239 public double getVisionTime()
240 {
241 return
242
243 partLocal.
244 getVisionTime()
245 ;
246 }
247
248 @Override
249
250 /**
251 *
252 If some additional debug information will be shown in the
253 UT2004 server console window.
254
255 */
256 public boolean isShowDebug()
257 {
258 return
259
260 partLocal.
261 isShowDebug()
262 ;
263 }
264
265 @Override
266
267 /**
268 *
269 If true an actor visualizing the location the bot is
270 actually looking at will appear in the game.
271
272 */
273 public boolean isShowFocalPoint()
274 {
275 return
276
277 partLocal.
278 isShowFocalPoint()
279 ;
280 }
281
282 @Override
283
284 /**
285 *
286 if the GB should draw lines representing the auto ray traces
287 of the bot (for more information see ATR message).
288
289 */
290 public boolean isDrawTraceLines()
291 {
292 return
293
294 partLocal.
295 isDrawTraceLines()
296 ;
297 }
298
299 @Override
300
301 /**
302 *
303 It informs if sending of all GB synchronous messages is
304 enabled or disabled.
305
306 */
307 public boolean isSynchronousOff()
308 {
309 return
310
311 partLocal.
312 isSynchronousOff()
313 ;
314 }
315
316 @Override
317
318 /**
319 *
320 It enables/disables automatic pickup of the bot. If true the items can be picked up through PICK command.
321
322 */
323 public boolean isAutoPickupOff()
324 {
325 return
326
327 partLocal.
328 isAutoPickupOff()
329 ;
330 }
331
332 @Override
333
334 /**
335 *
336 Name of current BDI action.
337
338 */
339 public String getAction()
340 {
341 return
342
343 partLocal.
344 getAction()
345 ;
346 }
347
348
349 public String toString() {
350 return
351 super.toString() + "[" +
352
353 "Static = " + String.valueOf(partStatic) + " | Local = " + String.valueOf(partLocal) + " | Shared = " + String.valueOf(partShared) + " ]" +
354
355 "]";
356 }
357
358
359 public String toHtmlString() {
360 return super.toString() + "[<br/>" +
361
362 "Static = " + String.valueOf(partStatic) + " <br/> Local = " + String.valueOf(partLocal) + " <br/> Shared = " + String.valueOf(partShared) + " ]" +
363
364 "<br/>]";
365 }
366
367
368 // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=all]) ---
369
370 // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=all]) ---
371
372 // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=composite+classtype[@name=impl]) ---
373
374 // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=composite+classtype[@name=impl]) ---
375
376 }
377