View Javadoc

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=event]+classtype[@name=impl] BEGIN
13  		
14  		// --- IMPORTS FROM extra/code/java/javapart/classcategory[@name=event]+classtype[@name=impl] END
15      
16   		/**
17           *  
18           			Definition of the event CTRLMSG.
19           		
20           *
21           *  <p></p><p></p>
22           *  Complete message documentation:               
23           *  
24  		Asynchronous message passing some control message.
25  	
26           */
27   	public class ControlMessage 
28    				extends InfoMessage
29      			implements IWorldEvent, IWorldChangeEvent
30      			
31  	    {
32   	
33      	/** Example how the message looks like - used during parser tests. */
34      	public static final String PROTOTYPE =
35      		"CTRLMSG {Type text}  {PS1 text}  {PS2 text}  {PS3 text}  {PI1 0}  {PI2 0}  {PI3 0}  {PF1 0}  {PF2 0}  {PF3 0}  {PB1 False}  {PB2 False}  {PB3 False} ";
36      
37      	
38      	
39      	/**
40      	 * Parameter-less contructor for the message.
41      	 */
42  		public ControlMessage()
43  		{
44  		}
45  	
46      	
47      	
48      	
49      	/**
50  		 * Creates new instance of the message ControlMessage.
51  		 * 
52  		Asynchronous message passing some control message.
53  	
54  		 * Corresponding GameBots message
55  		 *   
56  		 *   is
57  		 *   CTRLMSG.
58  		 * 
59   	  	 * 
60  		 *   
61  		 *     @param Type Custom type of the message.
62  		 *   
63  		 * 
64  		 *   
65  		 *     @param PS1 Param String 1
66  		 *   
67  		 * 
68  		 *   
69  		 *     @param PS2 Param String 2
70  		 *   
71  		 * 
72  		 *   
73  		 *     @param PS3 Param String 3
74  		 *   
75  		 * 
76  		 *   
77  		 *     @param PI1 Param Integer 1
78  		 *   
79  		 * 
80  		 *   
81  		 *     @param PI2 Param Integer 2
82  		 *   
83  		 * 
84  		 *   
85  		 *     @param PI3 Param Integer 3
86  		 *   
87  		 * 
88  		 *   
89  		 *     @param PF1 Param Double 1
90  		 *   
91  		 * 
92  		 *   
93  		 *     @param PF2 Param Double 2
94  		 *   
95  		 * 
96  		 *   
97  		 *     @param PF3 Param Double 3
98  		 *   
99  		 * 
100 		 *   
101 		 *     @param PB1 Param Boolean 1
102 		 *   
103 		 * 
104 		 *   
105 		 *     @param PB2 Param Boolean 2
106 		 *   
107 		 * 
108 		 *   
109 		 *     @param PB3 Param Boolean 3
110 		 *   
111 		 * 
112 		 */
113 		public ControlMessage(
114 			String Type,  String PS1,  String PS2,  String PS3,  Integer PI1,  Integer PI2,  Integer PI3,  Double PF1,  Double PF2,  Double PF3,  Boolean PB1,  Boolean PB2,  Boolean PB3
115 		) {
116 			
117 					this.Type = Type;
118 				
119 					this.PS1 = PS1;
120 				
121 					this.PS2 = PS2;
122 				
123 					this.PS3 = PS3;
124 				
125 					this.PI1 = PI1;
126 				
127 					this.PI2 = PI2;
128 				
129 					this.PI3 = PI3;
130 				
131 					this.PF1 = PF1;
132 				
133 					this.PF2 = PF2;
134 				
135 					this.PF3 = PF3;
136 				
137 					this.PB1 = PB1;
138 				
139 					this.PB2 = PB2;
140 				
141 					this.PB3 = PB3;
142 				
143 		}
144     
145     	/**
146 		 * Cloning constructor from the full message.
147 		 *
148 		 * @param original
149 		 */
150 		public ControlMessage(ControlMessage original) {		
151 			
152 					this.Type = original.getType()
153  	;
154 				
155 					this.PS1 = original.getPS1()
156  	;
157 				
158 					this.PS2 = original.getPS2()
159  	;
160 				
161 					this.PS3 = original.getPS3()
162  	;
163 				
164 					this.PI1 = original.getPI1()
165  	;
166 				
167 					this.PI2 = original.getPI2()
168  	;
169 				
170 					this.PI3 = original.getPI3()
171  	;
172 				
173 					this.PF1 = original.getPF1()
174  	;
175 				
176 					this.PF2 = original.getPF2()
177  	;
178 				
179 					this.PF3 = original.getPF3()
180  	;
181 				
182 					this.PB1 = original.isPB1()
183  	;
184 				
185 					this.PB2 = original.isPB2()
186  	;
187 				
188 					this.PB3 = original.isPB3()
189  	;
190 				
191 			this.SimTime = original.getSimTime();			
192 		}
193 		
194 	   		
195 			protected long SimTime;
196 				
197 			/**
198 			 * Simulation time in MILLI SECONDS !!!
199 			 */	
200 			@Override
201 			public long getSimTime() {
202 				return SimTime;
203 			}
204 						
205 			/**
206 			 * Used by Yylex to slip correct time of the object or programmatically.
207 			 */
208 			protected void setSimTime(long SimTime) {
209 				this.SimTime = SimTime;
210 			}
211 	   	
212     	
213 	    /**
214          * Custom type of the message. 
215          */
216         protected
217          String Type =
218        	null;
219 	
220  		/**
221          * Custom type of the message. 
222          */
223         public  String getType()
224  	 {
225     					return Type;
226     				}
227     			
228     	
229 	    /**
230          * Param String 1 
231          */
232         protected
233          String PS1 =
234        	null;
235 	
236  		/**
237          * Param String 1 
238          */
239         public  String getPS1()
240  	 {
241     					return PS1;
242     				}
243     			
244     	
245 	    /**
246          * Param String 2 
247          */
248         protected
249          String PS2 =
250        	null;
251 	
252  		/**
253          * Param String 2 
254          */
255         public  String getPS2()
256  	 {
257     					return PS2;
258     				}
259     			
260     	
261 	    /**
262          * Param String 3 
263          */
264         protected
265          String PS3 =
266        	null;
267 	
268  		/**
269          * Param String 3 
270          */
271         public  String getPS3()
272  	 {
273     					return PS3;
274     				}
275     			
276     	
277 	    /**
278          * Param Integer 1 
279          */
280         protected
281          Integer PI1 =
282        	null;
283 	
284  		/**
285          * Param Integer 1 
286          */
287         public  Integer getPI1()
288  	 {
289     					return PI1;
290     				}
291     			
292     	
293 	    /**
294          * Param Integer 2 
295          */
296         protected
297          Integer PI2 =
298        	null;
299 	
300  		/**
301          * Param Integer 2 
302          */
303         public  Integer getPI2()
304  	 {
305     					return PI2;
306     				}
307     			
308     	
309 	    /**
310          * Param Integer 3 
311          */
312         protected
313          Integer PI3 =
314        	null;
315 	
316  		/**
317          * Param Integer 3 
318          */
319         public  Integer getPI3()
320  	 {
321     					return PI3;
322     				}
323     			
324     	
325 	    /**
326          * Param Double 1 
327          */
328         protected
329          Double PF1 =
330        	null;
331 	
332  		/**
333          * Param Double 1 
334          */
335         public  Double getPF1()
336  	 {
337     					return PF1;
338     				}
339     			
340     	
341 	    /**
342          * Param Double 2 
343          */
344         protected
345          Double PF2 =
346        	null;
347 	
348  		/**
349          * Param Double 2 
350          */
351         public  Double getPF2()
352  	 {
353     					return PF2;
354     				}
355     			
356     	
357 	    /**
358          * Param Double 3 
359          */
360         protected
361          Double PF3 =
362        	null;
363 	
364  		/**
365          * Param Double 3 
366          */
367         public  Double getPF3()
368  	 {
369     					return PF3;
370     				}
371     			
372     	
373 	    /**
374          * Param Boolean 1 
375          */
376         protected
377          Boolean PB1 =
378        	null;
379 	
380  		/**
381          * Param Boolean 1 
382          */
383         public  Boolean isPB1()
384  	 {
385     					return PB1;
386     				}
387     			
388     	
389 	    /**
390          * Param Boolean 2 
391          */
392         protected
393          Boolean PB2 =
394        	null;
395 	
396  		/**
397          * Param Boolean 2 
398          */
399         public  Boolean isPB2()
400  	 {
401     					return PB2;
402     				}
403     			
404     	
405 	    /**
406          * Param Boolean 3 
407          */
408         protected
409          Boolean PB3 =
410        	null;
411 	
412  		/**
413          * Param Boolean 3 
414          */
415         public  Boolean isPB3()
416  	 {
417     					return PB3;
418     				}
419     			
420  		
421  	    public String toString() {
422             return
423             	super.toString() + "[" +
424             	
425 		              			"Type = " + String.valueOf(getType()
426  	) + " | " + 
427 		              		
428 		              			"PS1 = " + String.valueOf(getPS1()
429  	) + " | " + 
430 		              		
431 		              			"PS2 = " + String.valueOf(getPS2()
432  	) + " | " + 
433 		              		
434 		              			"PS3 = " + String.valueOf(getPS3()
435  	) + " | " + 
436 		              		
437 		              			"PI1 = " + String.valueOf(getPI1()
438  	) + " | " + 
439 		              		
440 		              			"PI2 = " + String.valueOf(getPI2()
441  	) + " | " + 
442 		              		
443 		              			"PI3 = " + String.valueOf(getPI3()
444  	) + " | " + 
445 		              		
446 		              			"PF1 = " + String.valueOf(getPF1()
447  	) + " | " + 
448 		              		
449 		              			"PF2 = " + String.valueOf(getPF2()
450  	) + " | " + 
451 		              		
452 		              			"PF3 = " + String.valueOf(getPF3()
453  	) + " | " + 
454 		              		
455 		              			"PB1 = " + String.valueOf(isPB1()
456  	) + " | " + 
457 		              		
458 		              			"PB2 = " + String.valueOf(isPB2()
459  	) + " | " + 
460 		              		
461 		              			"PB3 = " + String.valueOf(isPB3()
462  	) + " | " + 
463 		              		
464 				"]";           		
465         }
466  	
467  		
468  		public String toHtmlString() {
469  			return super.toString() + "[<br/>" +
470             	
471 		              			"<b>Type</b> = " + String.valueOf(getType()
472  	) + " <br/> " + 
473 		              		
474 		              			"<b>PS1</b> = " + String.valueOf(getPS1()
475  	) + " <br/> " + 
476 		              		
477 		              			"<b>PS2</b> = " + String.valueOf(getPS2()
478  	) + " <br/> " + 
479 		              		
480 		              			"<b>PS3</b> = " + String.valueOf(getPS3()
481  	) + " <br/> " + 
482 		              		
483 		              			"<b>PI1</b> = " + String.valueOf(getPI1()
484  	) + " <br/> " + 
485 		              		
486 		              			"<b>PI2</b> = " + String.valueOf(getPI2()
487  	) + " <br/> " + 
488 		              		
489 		              			"<b>PI3</b> = " + String.valueOf(getPI3()
490  	) + " <br/> " + 
491 		              		
492 		              			"<b>PF1</b> = " + String.valueOf(getPF1()
493  	) + " <br/> " + 
494 		              		
495 		              			"<b>PF2</b> = " + String.valueOf(getPF2()
496  	) + " <br/> " + 
497 		              		
498 		              			"<b>PF3</b> = " + String.valueOf(getPF3()
499  	) + " <br/> " + 
500 		              		
501 		              			"<b>PB1</b> = " + String.valueOf(isPB1()
502  	) + " <br/> " + 
503 		              		
504 		              			"<b>PB2</b> = " + String.valueOf(isPB2()
505  	) + " <br/> " + 
506 		              		
507 		              			"<b>PB3</b> = " + String.valueOf(isPB3()
508  	) + " <br/> " + 
509 		              		
510 				"<br/>]";     
511 		}
512  	
513  	    public String toJsonLiteral() {
514             return "controlmessage( "
515             		+
516 									(getType()
517  	 == null ? "null" :
518 										"\"" + getType()
519  	 + "\"" 
520 									)
521 								+ ", " + 
522 									(getPS1()
523  	 == null ? "null" :
524 										"\"" + getPS1()
525  	 + "\"" 
526 									)
527 								+ ", " + 
528 									(getPS2()
529  	 == null ? "null" :
530 										"\"" + getPS2()
531  	 + "\"" 
532 									)
533 								+ ", " + 
534 									(getPS3()
535  	 == null ? "null" :
536 										"\"" + getPS3()
537  	 + "\"" 
538 									)
539 								+ ", " + 
540 								    String.valueOf(getPI1()
541  	)									
542 								+ ", " + 
543 								    String.valueOf(getPI2()
544  	)									
545 								+ ", " + 
546 								    String.valueOf(getPI3()
547  	)									
548 								+ ", " + 
549 								    String.valueOf(getPF1()
550  	)									
551 								+ ", " + 
552 								    String.valueOf(getPF2()
553  	)									
554 								+ ", " + 
555 								    String.valueOf(getPF3()
556  	)									
557 								+ ", " + 
558 								    String.valueOf(isPB1()
559  	)									
560 								+ ", " + 
561 								    String.valueOf(isPB2()
562  	)									
563 								+ ", " + 
564 								    String.valueOf(isPB3()
565  	)									
566 								
567                    + ")";
568         }
569  	
570  		
571  		// --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=all]) ---
572         	
573 		// --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=all]) ---
574 		
575 	    // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=event+classtype[@name=impl]) ---
576 	        
577 	    // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=event+classtype[@name=impl]) ---        	            	
578  	
579 		}
580