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=local]+classtype[@name=abstract] BEGIN
13
14 // --- IMPORTS FROM extra/code/java/javapart/classcategory[@name=local]+classtype[@name=abstract] END
15
16 /**
17 *
18 Abstract definition of the local part of the GameBots2004 message CONFCH.
19
20 *
21 * <p></p><p></p>
22 * Complete message documentation:
23 *
24 Asynchronous message. Message sent when the bot configuration
25 changed - each agent has a lot of parameters affecting his state
26 in the environment. See each property for the details.
27
28 */
29 public abstract class ConfigChangeLocal
30 extends InfoMessage
31 implements ILocalWorldObject
32
33 {
34
35
36
37 /**
38 * Parameter-less contructor for the message.
39 */
40 public ConfigChangeLocal()
41 {
42 }
43
44 // abstract definition of the local-part of the message, no more constructors is needed
45
46
47 protected long SimTime;
48
49 /**
50 * Simulation time in MILLI SECONDS !!!
51 */
52 @Override
53 public long getSimTime() {
54 return SimTime;
55 }
56
57 /**
58 * Used by Yylex to slip correct time of the object or programmatically.
59 */
60 protected void setSimTime(long SimTime) {
61 this.SimTime = SimTime;
62 }
63
64
65 @Override
66 public abstract
67 ConfigChangeLocal clone();
68
69 @Override
70 public Class getCompositeClass() {
71 return ConfigChange.class;
72 }
73
74
75
76 /**
77 * Id of this config message. This Id is generated from BotId, string "_CONFCH" is added at the end.
78 */
79 public abstract UnrealId getId()
80 ;
81
82 /**
83 * Unique Id of the bot.
84 */
85 public abstract UnrealId getBotId()
86 ;
87
88 /**
89 *
90 True if we have to spawn the bot manually after each death
91
92 */
93 public abstract boolean isManualSpawn()
94 ;
95
96 /**
97 *
98 True if the bot is using auto ray tracing (is provided with
99 synchronous ATR messages). See ATR messages for more
100 details.
101
102 */
103 public abstract boolean isAutoTrace()
104 ;
105
106 /**
107 * The bot's name.
108 */
109 public abstract String getName()
110 ;
111
112 /**
113 *
114 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).
115
116 */
117 public abstract double getSpeedMultiplier()
118 ;
119
120 /**
121 *
122 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)
123
124 */
125 public abstract Rotation getRotationRate()
126 ;
127
128 /**
129 *
130 If bot is invulnerable (cannot die) or not.
131
132 */
133 public abstract boolean isInvulnerable()
134 ;
135
136 /**
137 *
138 The delay between two self message synchronous batches
139 (can range from 0.01 to 2 seconds). Will be used only if NewSelfBatchProtocol
140 attribute is set to true in INIT message.
141
142 */
143 public abstract double getSelfUpdateTime()
144 ;
145
146 /**
147 *
148 The delay between two synchronous batches containing vision updates
149 (can range from 0.1 to 2 seconds). If NewSelfBatchProtocol
150 attribute is set to true in INIT message, more batch messages containing only
151 SELF message will arrive between two vision update batches (containing PLR,PRJ,INV.. messages).
152
153 */
154 public abstract double getVisionTime()
155 ;
156
157 /**
158 *
159 If some additional debug information will be shown in the
160 UT2004 server console window.
161
162 */
163 public abstract boolean isShowDebug()
164 ;
165
166 /**
167 *
168 If true an actor visualizing the location the bot is
169 actually looking at will appear in the game.
170
171 */
172 public abstract boolean isShowFocalPoint()
173 ;
174
175 /**
176 *
177 if the GB should draw lines representing the auto ray traces
178 of the bot (for more information see ATR message).
179
180 */
181 public abstract boolean isDrawTraceLines()
182 ;
183
184 /**
185 *
186 It informs if sending of all GB synchronous messages is
187 enabled or disabled.
188
189 */
190 public abstract boolean isSynchronousOff()
191 ;
192
193 /**
194 *
195 It enables/disables automatic pickup of the bot. If true the items can be picked up through PICK command.
196
197 */
198 public abstract boolean isAutoPickupOff()
199 ;
200
201 /**
202 *
203 Name of current BDI action.
204
205 */
206 public abstract String getAction()
207 ;
208
209
210
211
212 public ConfigChangeLocal getLocal() {
213 return this;
214 }
215 public ISharedWorldObject getShared() {
216 throw new UnsupportedOperationException("Could not return LOCAL");
217 }
218 public IStaticWorldObject getStatic() {
219 throw new UnsupportedOperationException("Could not return LOCAL");
220 }
221
222
223
224 public String toString() {
225 return
226 super.toString() + "[" +
227
228 "Id = " + String.valueOf(getId()
229 ) + " | " +
230
231 "BotId = " + String.valueOf(getBotId()
232 ) + " | " +
233
234 "ManualSpawn = " + String.valueOf(isManualSpawn()
235 ) + " | " +
236
237 "AutoTrace = " + String.valueOf(isAutoTrace()
238 ) + " | " +
239
240 "Name = " + String.valueOf(getName()
241 ) + " | " +
242
243 "SpeedMultiplier = " + String.valueOf(getSpeedMultiplier()
244 ) + " | " +
245
246 "RotationRate = " + String.valueOf(getRotationRate()
247 ) + " | " +
248
249 "Invulnerable = " + String.valueOf(isInvulnerable()
250 ) + " | " +
251
252 "SelfUpdateTime = " + String.valueOf(getSelfUpdateTime()
253 ) + " | " +
254
255 "VisionTime = " + String.valueOf(getVisionTime()
256 ) + " | " +
257
258 "ShowDebug = " + String.valueOf(isShowDebug()
259 ) + " | " +
260
261 "ShowFocalPoint = " + String.valueOf(isShowFocalPoint()
262 ) + " | " +
263
264 "DrawTraceLines = " + String.valueOf(isDrawTraceLines()
265 ) + " | " +
266
267 "SynchronousOff = " + String.valueOf(isSynchronousOff()
268 ) + " | " +
269
270 "AutoPickupOff = " + String.valueOf(isAutoPickupOff()
271 ) + " | " +
272
273 "Action = " + String.valueOf(getAction()
274 ) + " | " +
275
276 "]";
277 }
278
279
280 public String toHtmlString() {
281 return super.toString() + "[<br/>" +
282
283 "<b>Id</b> = " + String.valueOf(getId()
284 ) + " <br/> " +
285
286 "<b>BotId</b> = " + String.valueOf(getBotId()
287 ) + " <br/> " +
288
289 "<b>ManualSpawn</b> = " + String.valueOf(isManualSpawn()
290 ) + " <br/> " +
291
292 "<b>AutoTrace</b> = " + String.valueOf(isAutoTrace()
293 ) + " <br/> " +
294
295 "<b>Name</b> = " + String.valueOf(getName()
296 ) + " <br/> " +
297
298 "<b>SpeedMultiplier</b> = " + String.valueOf(getSpeedMultiplier()
299 ) + " <br/> " +
300
301 "<b>RotationRate</b> = " + String.valueOf(getRotationRate()
302 ) + " <br/> " +
303
304 "<b>Invulnerable</b> = " + String.valueOf(isInvulnerable()
305 ) + " <br/> " +
306
307 "<b>SelfUpdateTime</b> = " + String.valueOf(getSelfUpdateTime()
308 ) + " <br/> " +
309
310 "<b>VisionTime</b> = " + String.valueOf(getVisionTime()
311 ) + " <br/> " +
312
313 "<b>ShowDebug</b> = " + String.valueOf(isShowDebug()
314 ) + " <br/> " +
315
316 "<b>ShowFocalPoint</b> = " + String.valueOf(isShowFocalPoint()
317 ) + " <br/> " +
318
319 "<b>DrawTraceLines</b> = " + String.valueOf(isDrawTraceLines()
320 ) + " <br/> " +
321
322 "<b>SynchronousOff</b> = " + String.valueOf(isSynchronousOff()
323 ) + " <br/> " +
324
325 "<b>AutoPickupOff</b> = " + String.valueOf(isAutoPickupOff()
326 ) + " <br/> " +
327
328 "<b>Action</b> = " + String.valueOf(getAction()
329 ) + " <br/> " +
330
331 "<br/>]";
332 }
333
334
335 // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=all]) ---
336
337 // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=all]) ---
338
339 // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=local+classtype[@name=abstract]) ---
340
341 // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=local+classtype[@name=abstract]) ---
342
343 }
344