View Javadoc

1   
2               /**
3               IMPORTANT !!!
4   
5               DO NOT EDIT THIS FILE. IT IS GENERATED FROM approriate xml file in xmlresources/gbcommands BY
6               THE JavaClassesGenerator.xslt. MODIFY THESE FILES INSTEAD OF THIS ONE.
7   
8               IMPORTANT END !!!
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  		Configures various attributes of the observer. You can include several of the parameters.
35  		The state of options you don't specify will remain unchanged.
36      
37                            Corresponding GameBots command is
38                            CONF.
39                        
40               */
41              
42              public class
43              ConfigurationObserver extends
44          CommandMessage
45  
46              {
47              
48              /**
49                Creates new instance of command ConfigurationObserver.
50                
51  		Configures various attributes of the observer. You can include several of the parameters.
52  		The state of options you don't specify will remain unchanged.
53      Corresponding GameBots message for this command is
54                CONF.
55                    @param UpdateTime 
56  			The frequency (in seconds) you will receive updates from the observer.
57  		
58                    @param Update 
59  			The frequency (in seconds) you will receive updates from the observer. Same as UpdateTime.
60  		
61                    @param Game 
62  			Whether to send game-related messages with every update.
63  			Affects the following messages: NFO, PLR.
64  		
65                    @param Self 
66  			Whether to send messages about the observed player with every update.
67  			Affects the following messages: SLF, MYINV.
68  		
69                    @param See 
70  			Whether to send messages about what the observed player sees with every update.
71  			Affects the following messages: PLR, INV, NAV, MOV, PRJ, VEH.
72  		
73                    @param Special 
74  			Whether to send messages about special objects on the map with every update.
75  			Affects the following messages: FLG, BOM, DOM.
76  		
77                    @param All 
78  			Toggles sending all messages with every update.
79              You can still receive the messages by asking for them using the commands GAME, SELF, SEE, SPECIAL and ALL.
80  		
81                    @param Async 
82  			Whether to send asynchronous messages, such as HIT or AIN.
83              Note that if you turn this off you will not be able to receive these messages at all.
84  		
85                */
86               public ConfigurationObserver(
87                  double UpdateTime,  double Update,  boolean Game,  boolean Self,  boolean See,  boolean Special,  boolean All,  boolean Async) {
88                      
89                      this.UpdateTime = UpdateTime;
90                  
91                      this.Update = Update;
92                  
93                      this.Game = Game;
94                  
95                      this.Self = Self;
96                  
97                      this.See = See;
98                  
99                      this.Special = Special;
100                 
101                     this.All = All;
102                 
103                     this.Async = Async;
104                 
105                 }
106 
107             
108             		/**
109 		             Creates new instance of command ConfigurationObserver.
110 		             
111 		Configures various attributes of the observer. You can include several of the parameters.
112 		The state of options you don't specify will remain unchanged.
113     Corresponding GameBots message for this command is
114 		             CONF.
115 		             <p></p>WARNING: this is empty-command constructor, you have to use setters to fill it up!
116 		             */
117             		public  ConfigurationObserver() {
118             		}
119             	
120 
121             /////// Properties BEGIN
122             
123         /**
124         
125 			The frequency (in seconds) you will receive updates from the observer.
126 		 */
127         protected
128          double UpdateTime =
129         	0;
130 
131         
132         /**
133         
134 			The frequency (in seconds) you will receive updates from the observer.
135 		 */
136         public
137         double getUpdateTime() {
138             return
139          UpdateTime;
140         }
141         
142 
143         
144             /**
145         
146 			The frequency (in seconds) you will receive updates from the observer.
147 		 */
148         public ConfigurationObserver setUpdateTime(double UpdateTime) {
149             this.UpdateTime = UpdateTime;
150             return this;
151             }
152        
153         /**
154         
155 			The frequency (in seconds) you will receive updates from the observer. Same as UpdateTime.
156 		 */
157         protected
158          double Update =
159         	0;
160 
161         
162         /**
163         
164 			The frequency (in seconds) you will receive updates from the observer. Same as UpdateTime.
165 		 */
166         public
167         double getUpdate() {
168             return
169          Update;
170         }
171         
172 
173         
174             /**
175         
176 			The frequency (in seconds) you will receive updates from the observer. Same as UpdateTime.
177 		 */
178         public ConfigurationObserver setUpdate(double Update) {
179             this.Update = Update;
180             return this;
181             }
182        
183         /**
184         
185 			Whether to send game-related messages with every update.
186 			Affects the following messages: NFO, PLR.
187 		 */
188         protected
189          boolean Game =
190         	false;
191 
192         
193         /**
194         
195 			Whether to send game-related messages with every update.
196 			Affects the following messages: NFO, PLR.
197 		 */
198         public
199         boolean isGame() {
200             return
201          Game;
202         }
203         
204 
205         
206             /**
207         
208 			Whether to send game-related messages with every update.
209 			Affects the following messages: NFO, PLR.
210 		 */
211         public ConfigurationObserver setGame(boolean Game) {
212             this.Game = Game;
213             return this;
214             }
215        
216         /**
217         
218 			Whether to send messages about the observed player with every update.
219 			Affects the following messages: SLF, MYINV.
220 		 */
221         protected
222          boolean Self =
223         	false;
224 
225         
226         /**
227         
228 			Whether to send messages about the observed player with every update.
229 			Affects the following messages: SLF, MYINV.
230 		 */
231         public
232         boolean isSelf() {
233             return
234          Self;
235         }
236         
237 
238         
239             /**
240         
241 			Whether to send messages about the observed player with every update.
242 			Affects the following messages: SLF, MYINV.
243 		 */
244         public ConfigurationObserver setSelf(boolean Self) {
245             this.Self = Self;
246             return this;
247             }
248        
249         /**
250         
251 			Whether to send messages about what the observed player sees with every update.
252 			Affects the following messages: PLR, INV, NAV, MOV, PRJ, VEH.
253 		 */
254         protected
255          boolean See =
256         	false;
257 
258         
259         /**
260         
261 			Whether to send messages about what the observed player sees with every update.
262 			Affects the following messages: PLR, INV, NAV, MOV, PRJ, VEH.
263 		 */
264         public
265         boolean isSee() {
266             return
267          See;
268         }
269         
270 
271         
272             /**
273         
274 			Whether to send messages about what the observed player sees with every update.
275 			Affects the following messages: PLR, INV, NAV, MOV, PRJ, VEH.
276 		 */
277         public ConfigurationObserver setSee(boolean See) {
278             this.See = See;
279             return this;
280             }
281        
282         /**
283         
284 			Whether to send messages about special objects on the map with every update.
285 			Affects the following messages: FLG, BOM, DOM.
286 		 */
287         protected
288          boolean Special =
289         	false;
290 
291         
292         /**
293         
294 			Whether to send messages about special objects on the map with every update.
295 			Affects the following messages: FLG, BOM, DOM.
296 		 */
297         public
298         boolean isSpecial() {
299             return
300          Special;
301         }
302         
303 
304         
305             /**
306         
307 			Whether to send messages about special objects on the map with every update.
308 			Affects the following messages: FLG, BOM, DOM.
309 		 */
310         public ConfigurationObserver setSpecial(boolean Special) {
311             this.Special = Special;
312             return this;
313             }
314        
315         /**
316         
317 			Toggles sending all messages with every update.
318             You can still receive the messages by asking for them using the commands GAME, SELF, SEE, SPECIAL and ALL.
319 		 */
320         protected
321          boolean All =
322         	false;
323 
324         
325         /**
326         
327 			Toggles sending all messages with every update.
328             You can still receive the messages by asking for them using the commands GAME, SELF, SEE, SPECIAL and ALL.
329 		 */
330         public
331         boolean isAll() {
332             return
333          All;
334         }
335         
336 
337         
338             /**
339         
340 			Toggles sending all messages with every update.
341             You can still receive the messages by asking for them using the commands GAME, SELF, SEE, SPECIAL and ALL.
342 		 */
343         public ConfigurationObserver setAll(boolean All) {
344             this.All = All;
345             return this;
346             }
347        
348         /**
349         
350 			Whether to send asynchronous messages, such as HIT or AIN.
351             Note that if you turn this off you will not be able to receive these messages at all.
352 		 */
353         protected
354          boolean Async =
355         	false;
356 
357         
358         /**
359         
360 			Whether to send asynchronous messages, such as HIT or AIN.
361             Note that if you turn this off you will not be able to receive these messages at all.
362 		 */
363         public
364         boolean isAsync() {
365             return
366          Async;
367         }
368         
369 
370         
371             /**
372         
373 			Whether to send asynchronous messages, such as HIT or AIN.
374             Note that if you turn this off you will not be able to receive these messages at all.
375 		 */
376         public ConfigurationObserver setAsync(boolean Async) {
377             this.Async = Async;
378             return this;
379             }
380        
381             /////// Properties END
382 
383             /////// Extra Java code BEGIN
384 
385             	/////// Additional code from xslt BEGIN
386             		
387 
388 
389             	/////// Additional code from xslt END
390 
391 	            /////// Extra Java from XML BEGIN
392             		
393             	/////// Extra Java from XML END
394 
395             /////// Extra Java code END
396 
397             
398 
399             /**
400               * Cloning constructor.
401               */
402              public ConfigurationObserver(ConfigurationObserver original) {
403                 
404                      this.UpdateTime=original.UpdateTime;
405                 
406                      this.Update=original.Update;
407                 
408                      this.Game=original.Game;
409                 
410                      this.Self=original.Self;
411                 
412                      this.See=original.See;
413                 
414                      this.Special=original.Special;
415                 
416                      this.All=original.All;
417                 
418                      this.Async=original.Async;
419                 
420              }
421 
422              
423 
424                  
425             public String toString() {
426                 return
427                 
428                     	toMessage();
429                     
430              }
431 
432              public String toHtmlString() {
433                 return super.toString() +
434             
435             "<b>UpdateTime</b> : " +
436             String.valueOf(UpdateTime) +
437             " <br/> " +
438             
439             "<b>Update</b> : " +
440             String.valueOf(Update) +
441             " <br/> " +
442             
443             "<b>Game</b> : " +
444             String.valueOf(Game) +
445             " <br/> " +
446             
447             "<b>Self</b> : " +
448             String.valueOf(Self) +
449             " <br/> " +
450             
451             "<b>See</b> : " +
452             String.valueOf(See) +
453             " <br/> " +
454             
455             "<b>Special</b> : " +
456             String.valueOf(Special) +
457             " <br/> " +
458             
459             "<b>All</b> : " +
460             String.valueOf(All) +
461             " <br/> " +
462             
463             "<b>Async</b> : " +
464             String.valueOf(Async) +
465             " <br/> " +
466              "";
467              }
468 
469              
470              
471              	 public String toMessage() {
472               		StringBuffer buf = new StringBuffer();
473               		buf.append("CONF");
474               		
475 		    					buf.append(" {UpdateTime " + UpdateTime + "}");
476 		    				
477 		    					buf.append(" {Update " + Update + "}");
478 		    				
479 		    					buf.append(" {Game " + Game + "}");
480 		    				
481 		    					buf.append(" {Self " + Self + "}");
482 		    				
483 		    					buf.append(" {See " + See + "}");
484 		    				
485 		    					buf.append(" {Special " + Special + "}");
486 		    				
487 		    					buf.append(" {All " + All + "}");
488 		    				
489 		    					buf.append(" {Async " + Async + "}");
490 		    				
491             		return buf.toString();
492             }
493              
494              }
495 
496