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=base]+classtype[@name=message] BEGIN
13  		
14  		// --- IMPORTS FROM extra/code/java/javapart/classcategory[@name=base]+classtype[@name=message] END
15      
16   		/**
17           *  
18               				Implementation of the GameBots2004 message BOM contains also its Local/Shared/Static subpart class definitions..  
19              			
20           *
21           *  <p></p><p></p>
22           *  Complete message documentation:               
23           *  
24  		Synchronous message. BombInfo contains all info about the bomb
25  		in the BotBombingRun game mode. Is not sent in other game types.
26  	
27           */
28   	public class BombInfoMessage   
29    				extends 
30    				BombInfo
31    						implements IWorldObjectUpdatedEvent, ICompositeWorldObjectUpdatedEvent
32    						
33  	    {
34   	
35      	
36      	
37      	/**
38      	 * Parameter-less contructor for the message.
39      	 */
40  		public BombInfoMessage()
41  		{
42  		}
43  	
44      	
45      	
46      	
47      	/**
48  		 * Creates new instance of the message BombInfo.
49  		 * 
50  		Synchronous message. BombInfo contains all info about the bomb
51  		in the BotBombingRun game mode. Is not sent in other game types.
52  	
53  		 * Corresponding GameBots message
54  		 *   
55  		 *   is
56  		 *   BOM.
57  		 * 
58   	  	 * 
59  		 *   
60  		 *     @param Id 
61  			An unique Id for this bomb, assigned by the game.
62  		
63  		 *   
64  		 * 
65  		 *   
66  		 *     @param Velocity 
67     		Current velocity of the bomb. TODO not sure if this actually does smthing
68     	
69  		 *   
70  		 * 
71  		 *   
72  		 *     @param Location 
73  			An absolute location of the bomb (Sent if we can actually
74  			see the flag).
75  		
76  		 *   
77  		 * 
78  		 *   
79  		 *     @param Holder 
80  			Id of player/bot holding the bomb. (Sent if we can actually
81  			see the bomb and the bomb is being carried, or if the bomb
82  			is being carried by us).
83  		
84  		 *   
85  		 * 
86  		 *   
87  		 *     @param HolderTeam 
88  			The team of the current holder (if any).
89  		
90  		 *   
91  		 * 
92  		 *   
93  		 *     @param Visible True if the bot can see the bomb.
94  		 *   
95  		 * 
96  		 *   
97  		 *     @param State 
98  			Represents the state the bomb is in. Can be "Held",
99  			"Dropped" or "Home".
100 		
101 		 *   
102 		 * 
103 		 */
104 		public BombInfoMessage(
105 			UnrealId Id,  Velocity Velocity,  Location Location,  UnrealId Holder,  Integer HolderTeam,  boolean Visible,  String State
106 		) {
107 			
108 					this.Id = Id;
109 				
110 					this.Velocity = Velocity;
111 				
112 					this.Location = Location;
113 				
114 					this.Holder = Holder;
115 				
116 					this.HolderTeam = HolderTeam;
117 				
118 					this.Visible = Visible;
119 				
120 					this.State = State;
121 				
122 		}
123     
124 		/**
125 		 * Cloning constructor from the full message.
126 		 *
127 		 * @param original
128 		 */
129 		public BombInfoMessage(BombInfoMessage original) {		
130 			
131 					this.Id = original.getId()
132  	;
133 				
134 					this.Velocity = original.getVelocity()
135  	;
136 				
137 					this.Location = original.getLocation()
138  	;
139 				
140 					this.Holder = original.getHolder()
141  	;
142 				
143 					this.HolderTeam = original.getHolderTeam()
144  	;
145 				
146 					this.Visible = original.isVisible()
147  	;
148 				
149 					this.State = original.getState()
150  	;
151 				
152 				this.TeamId = original.getTeamId();
153 			
154 			this.SimTime = original.getSimTime();
155 		}
156 		
157     				
158     					protected ITeamId TeamId;
159     					
160     					/**
161     					 * Used by Yylex to slip corretn TeamId.
162     					 */
163     					protected void setTeamId(ITeamId TeamId) {
164     					    this.TeamId = TeamId;
165     					}
166     				
167     					public ITeamId getTeamId() {
168 							return TeamId;
169 						}
170     	
171     					
172     					
173     	
174 	    /**
175          * 
176 			An unique Id for this bomb, assigned by the game.
177 		 
178          */
179         protected
180          UnrealId Id =
181        	null;
182 	
183     						
184     						/**
185 		 					 * Whether property 'Id' was received from GB2004.
186 		 					 */
187 							protected boolean Id_Set = false;
188 							
189     						@Override
190 		    				
191  		/**
192          * 
193 			An unique Id for this bomb, assigned by the game.
194 		 
195          */
196         public  UnrealId getId()
197  	 {
198 		    					return Id;
199 		    				}
200 		    			
201     	
202 	    /**
203          * 
204    		Current velocity of the bomb. TODO not sure if this actually does smthing
205    	 
206          */
207         protected
208          Velocity Velocity =
209        	null;
210 	
211     						
212     						/**
213 		 					 * Whether property 'Velocity' was received from GB2004.
214 		 					 */
215 							protected boolean Velocity_Set = false;
216 							
217     						@Override
218 		    				
219  		/**
220          * 
221    		Current velocity of the bomb. TODO not sure if this actually does smthing
222    	 
223          */
224         public  Velocity getVelocity()
225  	 {
226 		    					return Velocity;
227 		    				}
228 		    			
229     	
230 	    /**
231          * 
232 			An absolute location of the bomb (Sent if we can actually
233 			see the flag).
234 		 
235          */
236         protected
237          Location Location =
238        	null;
239 	
240     						
241     						/**
242 		 					 * Whether property 'Location' was received from GB2004.
243 		 					 */
244 							protected boolean Location_Set = false;
245 							
246     						@Override
247 		    				
248  		/**
249          * 
250 			An absolute location of the bomb (Sent if we can actually
251 			see the flag).
252 		 
253          */
254         public  Location getLocation()
255  	 {
256 		    					return Location;
257 		    				}
258 		    			
259     	
260 	    /**
261          * 
262 			Id of player/bot holding the bomb. (Sent if we can actually
263 			see the bomb and the bomb is being carried, or if the bomb
264 			is being carried by us).
265 		 
266          */
267         protected
268          UnrealId Holder =
269        	null;
270 	
271     						
272     						/**
273 		 					 * Whether property 'Holder' was received from GB2004.
274 		 					 */
275 							protected boolean Holder_Set = false;
276 							
277     						@Override
278 		    				
279  		/**
280          * 
281 			Id of player/bot holding the bomb. (Sent if we can actually
282 			see the bomb and the bomb is being carried, or if the bomb
283 			is being carried by us).
284 		 
285          */
286         public  UnrealId getHolder()
287  	 {
288 		    					return Holder;
289 		    				}
290 		    			
291     	
292 	    /**
293          * 
294 			The team of the current holder (if any).
295 		 
296          */
297         protected
298          Integer HolderTeam =
299        	255;
300 	
301     						
302     						/**
303 		 					 * Whether property 'HolderTeam' was received from GB2004.
304 		 					 */
305 							protected boolean HolderTeam_Set = false;
306 							
307     						@Override
308 		    				
309  		/**
310          * 
311 			The team of the current holder (if any).
312 		 
313          */
314         public  Integer getHolderTeam()
315  	 {
316 		    					return HolderTeam;
317 		    				}
318 		    			
319     	
320 	    /**
321          * True if the bot can see the bomb. 
322          */
323         protected
324          boolean Visible =
325        	false;
326 	
327     						
328     						/**
329 		 					 * Whether property 'Visible' was received from GB2004.
330 		 					 */
331 							protected boolean Visible_Set = false;
332 							
333     						@Override
334 		    				
335  		/**
336          * True if the bot can see the bomb. 
337          */
338         public  boolean isVisible()
339  	 {
340 		    					return Visible;
341 		    				}
342 		    			
343     	
344 	    /**
345          * 
346 			Represents the state the bomb is in. Can be "Held",
347 			"Dropped" or "Home".
348 		 
349          */
350         protected
351          String State =
352        	null;
353 	
354     						
355     						/**
356 		 					 * Whether property 'State' was received from GB2004.
357 		 					 */
358 							protected boolean State_Set = false;
359 							
360     						@Override
361 		    				
362  		/**
363          * 
364 			Represents the state the bomb is in. Can be "Held",
365 			"Dropped" or "Home".
366 		 
367          */
368         public  String getState()
369  	 {
370 		    					return State;
371 		    				}
372 		    			
373 		    			
374 		    			private BombInfoLocal localPart = null;
375 		    			
376 		    			@Override
377 						public BombInfoLocal 
378 						getLocal() {
379 							if (localPart != null) return localPart;
380 							return localPart = new 
381 								BombInfoLocalMessage();
382 						}
383 					
384 						private BombInfoShared sharedPart = null;
385 					
386 						@Override
387 						public BombInfoShared 
388 						getShared() {
389 							if (sharedPart != null) return sharedPart;							
390 							return sharedPart = new 
391 								BombInfoSharedMessage();
392 						}
393 					
394 						private BombInfoStatic staticPart = null; 
395 					
396 						@Override
397 						public BombInfoStatic 
398 						getStatic() {
399 							if (staticPart != null) return staticPart;
400 							return staticPart = new 
401 								BombInfoStaticMessage();
402 						}
403     				
404  		/**
405          *  
406             				Implementation of the local part of the GameBots2004 message BOM, used
407             				to facade BOMMessage.  
408             			
409          *
410          *  <p></p><p></p>
411          *  Complete message documentation:               
412          *  
413 		Synchronous message. BombInfo contains all info about the bomb
414 		in the BotBombingRun game mode. Is not sent in other game types.
415 	
416          */
417  	public class BombInfoLocalMessage 
418 	  					extends
419   						BombInfoLocal
420 	    {
421  	
422 		    			@Override
423 		    			public 
424 		    			BombInfoLocalMessage clone() {
425 		    				return this;
426 		    			}
427 		    			
428 		    				public BombInfoLocalMessage getLocal() {
429 								return this;
430 					    	}
431 							public ISharedWorldObject getShared() {
432 							 	throw new UnsupportedOperationException("Could not return LOCAL as SHARED");
433 							}
434 							public IStaticWorldObject getStatic() {
435 							    throw new UnsupportedOperationException("Could not return LOCAL as STATIC");
436 							}
437 		    			
438  		/**
439          * 
440 			An unique Id for this bomb, assigned by the game.
441 		 
442          */
443         public  UnrealId getId()
444  	 {
445 				    					return Id;
446 				    				}
447 				    			
448  		/**
449          * True if the bot can see the bomb. 
450          */
451         public  boolean isVisible()
452  	 {
453 				    					return Visible;
454 				    				}
455 				    			
456  		
457  	    public String toString() {
458             return
459             	super.toString() + "[" +
460             	
461 		              			"Id = " + String.valueOf(getId()
462  	) + " | " + 
463 		              		
464 		              			"Visible = " + String.valueOf(isVisible()
465  	) + " | " + 
466 		              		
467 				"]";           		
468         }
469  	
470  		
471  		public String toHtmlString() {
472  			return super.toString() + "[<br/>" +
473             	
474 		              			"<b>Id</b> = " + String.valueOf(getId()
475  	) + " <br/> " + 
476 		              		
477 		              			"<b>Visible</b> = " + String.valueOf(isVisible()
478  	) + " <br/> " + 
479 		              		
480 				"<br/>]";     
481 		}
482  	
483  		
484  		// --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=all]) ---
485         	
486 		// --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=all]) ---
487 		
488 	    // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=local+classtype[@name=message]) ---
489 	        
490 	    // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=local+classtype[@name=message]) ---        	            	
491  	
492 		}
493  	
494  		/**
495          *  
496             				Implementation of the static part of the GameBots2004 message BOM, used
497             				to facade BOMMessage.  
498             			
499          *
500          *  <p></p><p></p>
501          *  Complete message documentation:               
502          *  
503 		Synchronous message. BombInfo contains all info about the bomb
504 		in the BotBombingRun game mode. Is not sent in other game types.
505 	
506          */
507  	public class BombInfoStaticMessage 
508 	  					extends
509   						BombInfoStatic
510 	    {
511  	
512 		    			@Override
513 		    			public 
514 		    			BombInfoStaticMessage clone() {
515 		    				return this;
516 		    			}
517 		    			
518  		/**
519          * 
520 			An unique Id for this bomb, assigned by the game.
521 		 
522          */
523         public  UnrealId getId()
524  	 {
525 				    					return Id;
526 				    				}
527 				    			
528  		
529  		@Override
530  		public boolean isDifferentFrom(IStaticWorldObject other)
531  		{
532  			if (other == null) //early fail
533  			{
534  				return true;
535  			}
536  			else if (other == this) //early out
537  			{
538  				return false;
539  			}
540  			else
541  			{
542  				BombInfoStatic obj = (BombInfoStatic) other;
543 
544  				
545  						if ( !(
546  	 			AdvancedEquals.equalsOrNull(this.getId()
547  	, obj.getId()
548  	)
549  	 		) )
550 						{
551 							System.out.println("!!!!!PROPERTY UPDATE ERROR!!!! on property Id on object class BombInfoStatic");
552 							return true;
553 						}
554  					
555  			}
556  			return false;
557  		}
558  	 
559  		
560  	    public String toString() {
561             return
562             	super.toString() + "[" +
563             	
564 		              			"Id = " + String.valueOf(getId()
565  	) + " | " + 
566 		              		
567 				"]";           		
568         }
569  	
570  		
571  		public String toHtmlString() {
572  			return super.toString() + "[<br/>" +
573             	
574 		              			"<b>Id</b> = " + String.valueOf(getId()
575  	) + " <br/> " + 
576 		              		
577 				"<br/>]";     
578 		}
579  	
580  		
581  		// --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=all]) ---
582         	
583 		// --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=all]) ---
584 		
585 	    // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=static+classtype[@name=message]) ---
586 	        
587 	    // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=static+classtype[@name=message]) ---        	            	
588  	
589 		}
590  	
591  		/**
592          *  
593             				Implementation of the shared part of the GameBots2004 message BOM, used
594             				to facade BOMMessage.  
595             			
596          *
597          *  <p></p><p></p>
598          *  Complete message documentation:               
599          *  
600 		Synchronous message. BombInfo contains all info about the bomb
601 		in the BotBombingRun game mode. Is not sent in other game types.
602 	
603          */
604  	public class BombInfoSharedMessage 
605 	  					extends
606   						BombInfoShared
607 	    {
608  	
609     	
610     	
611 		public BombInfoSharedMessage()
612 		{
613 			
614 				propertyMap.put(myVelocity.getPropertyId(), myVelocity);
615 			
616 				propertyMap.put(myLocation.getPropertyId(), myLocation);
617 			
618 				propertyMap.put(myHolder.getPropertyId(), myHolder);
619 			
620 				propertyMap.put(myHolderTeam.getPropertyId(), myHolderTeam);
621 			
622 				propertyMap.put(myState.getPropertyId(), myState);
623 			
624 		}		
625     
626 		    			@Override
627 		    			public 
628 		    			BombInfoSharedMessage clone() {
629 		    				return this;
630 		    			}
631 		    			
632 		
633 		
634 		
635 		protected HashMap<PropertyId, ISharedProperty> propertyMap = new HashMap<PropertyId, ISharedProperty>(
636 			5
637 		);
638 		
639 		@Override
640 		public ISharedProperty getProperty(PropertyId id) {
641 			return propertyMap.get(id);
642 		}
643 
644 		@Override
645 		public Map<PropertyId, ISharedProperty> getProperties() {
646 			return propertyMap;
647 		}
648 	
649 		
650 		
651  		/**
652          * 
653 			An unique Id for this bomb, assigned by the game.
654 		 
655          */
656         public  UnrealId getId()
657  	 {
658   			return Id;
659   		}
660   		
661     	
662 	    /**
663          * 
664    		Current velocity of the bomb. TODO not sure if this actually does smthing
665    	 
666          */
667         protected
668          VelocityProperty 
669         myVelocity
670 					= new
671 					VelocityProperty
672 					(
673 						getId(), 
674 						"Velocity", 
675 						Velocity, 
676 						BombInfo.class
677 					);
678 					
679  		/**
680          * 
681    		Current velocity of the bomb. TODO not sure if this actually does smthing
682    	 
683          */
684         public  Velocity getVelocity()
685  	 {
686 			  			return myVelocity.getValue();
687 			  		}
688 				
689     	
690 	    /**
691          * 
692 			An absolute location of the bomb (Sent if we can actually
693 			see the flag).
694 		 
695          */
696         protected
697          LocationProperty 
698         myLocation
699 					= new
700 					LocationProperty
701 					(
702 						getId(), 
703 						"Location", 
704 						Location, 
705 						BombInfo.class
706 					);
707 					
708  		/**
709          * 
710 			An absolute location of the bomb (Sent if we can actually
711 			see the flag).
712 		 
713          */
714         public  Location getLocation()
715  	 {
716 			  			return myLocation.getValue();
717 			  		}
718 				
719     	
720 	    /**
721          * 
722 			Id of player/bot holding the bomb. (Sent if we can actually
723 			see the bomb and the bomb is being carried, or if the bomb
724 			is being carried by us).
725 		 
726          */
727         protected
728          UnrealIdProperty 
729         myHolder
730 					= new
731 					UnrealIdProperty
732 					(
733 						getId(), 
734 						"Holder", 
735 						Holder, 
736 						BombInfo.class
737 					);
738 					
739  		/**
740          * 
741 			Id of player/bot holding the bomb. (Sent if we can actually
742 			see the bomb and the bomb is being carried, or if the bomb
743 			is being carried by us).
744 		 
745          */
746         public  UnrealId getHolder()
747  	 {
748 			  			return myHolder.getValue();
749 			  		}
750 				
751     	
752 	    /**
753          * 
754 			The team of the current holder (if any).
755 		 
756          */
757         protected
758          IntegerProperty 
759         myHolderTeam
760 					= new
761 					IntegerProperty
762 					(
763 						getId(), 
764 						"HolderTeam", 
765 						HolderTeam, 
766 						BombInfo.class
767 					);
768 					
769  		/**
770          * 
771 			The team of the current holder (if any).
772 		 
773          */
774         public  Integer getHolderTeam()
775  	 {
776 			  			return myHolderTeam.getValue();
777 			  		}
778 				
779     	
780 	    /**
781          * 
782 			Represents the state the bomb is in. Can be "Held",
783 			"Dropped" or "Home".
784 		 
785          */
786         protected
787          StringProperty 
788         myState
789 					= new
790 					StringProperty
791 					(
792 						getId(), 
793 						"State", 
794 						State, 
795 						BombInfo.class
796 					);
797 					
798  		/**
799          * 
800 			Represents the state the bomb is in. Can be "Held",
801 			"Dropped" or "Home".
802 		 
803          */
804         public  String getState()
805  	 {
806 			  			return myState.getValue();
807 			  		}
808 				
809  		
810  	    public String toString() {
811             return
812             	super.toString() + "[" +
813             	
814 		              			"Id = " + String.valueOf(getId()
815  	) + " | " + 
816 		              		
817 		              			"Velocity = " + String.valueOf(getVelocity()
818  	) + " | " + 
819 		              		
820 		              			"Location = " + String.valueOf(getLocation()
821  	) + " | " + 
822 		              		
823 		              			"Holder = " + String.valueOf(getHolder()
824  	) + " | " + 
825 		              		
826 		              			"HolderTeam = " + String.valueOf(getHolderTeam()
827  	) + " | " + 
828 		              		
829 		              			"State = " + String.valueOf(getState()
830  	) + " | " + 
831 		              		
832 				"]";           		
833         }
834  	
835  		
836  		public String toHtmlString() {
837  			return super.toString() + "[<br/>" +
838             	
839 		              			"<b>Id</b> = " + String.valueOf(getId()
840  	) + " <br/> " + 
841 		              		
842 		              			"<b>Velocity</b> = " + String.valueOf(getVelocity()
843  	) + " <br/> " + 
844 		              		
845 		              			"<b>Location</b> = " + String.valueOf(getLocation()
846  	) + " <br/> " + 
847 		              		
848 		              			"<b>Holder</b> = " + String.valueOf(getHolder()
849  	) + " <br/> " + 
850 		              		
851 		              			"<b>HolderTeam</b> = " + String.valueOf(getHolderTeam()
852  	) + " <br/> " + 
853 		              		
854 		              			"<b>State</b> = " + String.valueOf(getState()
855  	) + " <br/> " + 
856 		              		
857 				"<br/>]";     
858 		}
859  	
860  		
861  		// --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=all]) ---
862         	
863 		// --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=all]) ---
864 		
865 	    // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=shared+classtype[@name=message]) ---
866 	        
867 	    // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=shared+classtype[@name=message]) ---        	            	
868  	
869 		}
870  	
871     	
872     	
873  	
874 		@Override
875 		public IWorldObjectUpdateResult<IWorldObject> update(IWorldObject object) {
876 			if (object == null)
877 			{
878 				return new IWorldObjectUpdateResult.WorldObjectUpdateResult(IWorldObjectUpdateResult.Result.CREATED, this);
879 			}
880 			if (!( object instanceof BombInfoMessage) ) {
881 				throw new PogamutException("Can't update different class than BombInfoMessage, got class " + object.getClass().getSimpleName() + "!", this);		
882 			}
883 			BombInfoMessage toUpdate = (BombInfoMessage)object;
884 			
885 			boolean updated = false;
886 			
887 			// UPDATING LOCAL PROPERTIES
888 			
889 				if (toUpdate.Visible != isVisible()
890  	) {
891 				    toUpdate.Visible=isVisible()
892  	;
893 					updated = true;
894 				}
895 			
896          	
897          	// UPDATING SHARED PROPERTIES
898          	
899 				if (!SafeEquals.equals(toUpdate.Velocity, getVelocity()
900  	)) {
901 					toUpdate.Velocity=getVelocity()
902  	;
903 					updated = true;
904 				}
905 			
906 	            if (!SafeEquals.equals(toUpdate.Location, getLocation()
907  	)) {
908 					toUpdate.Location=getLocation()
909  	;
910 					updated = true;
911 				}
912 			
913 				if (!SafeEquals.equals(toUpdate.Holder, getHolder()
914  	)) {
915 					toUpdate.Holder=getHolder()
916  	;
917 					updated = true;
918 				}
919 			
920 				if (!SafeEquals.equals(toUpdate.HolderTeam, getHolderTeam()
921  	)) {
922 					toUpdate.HolderTeam=getHolderTeam()
923  	;
924 					updated = true;
925 				}
926 			
927 				if (!SafeEquals.equals(toUpdate.State, getState()
928  	)) {
929 					toUpdate.State=getState()
930  	;
931 					updated = true;
932 				}
933 			
934          	
935          	// UPDATE TIME
936          	toUpdate.SimTime = SimTime;
937 			
938 			if (updated) {
939 				return new IWorldObjectUpdateResult.WorldObjectUpdateResult<IWorldObject>(IWorldObjectUpdateResult.Result.UPDATED, toUpdate);
940 			} else {
941 				return new IWorldObjectUpdateResult.WorldObjectUpdateResult<IWorldObject>(IWorldObjectUpdateResult.Result.SAME, toUpdate);
942 			}
943 		}
944 		
945 		@Override
946 		public ILocalWorldObjectUpdatedEvent getLocalEvent() {
947 			return new BombInfoLocalImpl.BombInfoLocalUpdate
948     (this.getLocal(), SimTime);
949 		}
950 
951 		@Override
952 		public ISharedWorldObjectUpdatedEvent getSharedEvent() {
953 			return new BombInfoSharedImpl.BombInfoSharedUpdate
954     (this.getShared(), SimTime, this.getTeamId());
955 		}
956 
957 		@Override
958 		public IStaticWorldObjectUpdatedEvent getStaticEvent() {
959 			return new BombInfoStaticImpl.BombInfoStaticUpdate
960     (this.getStatic(), SimTime);
961 		}
962  	
963  		
964  	    public String toString() {
965             return
966             	super.toString() + "[" +
967             	
968 		              			"Id = " + String.valueOf(getId()
969  	) + " | " + 
970 		              		
971 		              			"Velocity = " + String.valueOf(getVelocity()
972  	) + " | " + 
973 		              		
974 		              			"Location = " + String.valueOf(getLocation()
975  	) + " | " + 
976 		              		
977 		              			"Holder = " + String.valueOf(getHolder()
978  	) + " | " + 
979 		              		
980 		              			"HolderTeam = " + String.valueOf(getHolderTeam()
981  	) + " | " + 
982 		              		
983 		              			"Visible = " + String.valueOf(isVisible()
984  	) + " | " + 
985 		              		
986 		              			"State = " + String.valueOf(getState()
987  	) + " | " + 
988 		              		
989 				"]";           		
990         }
991  	
992  		
993  		public String toHtmlString() {
994  			return super.toString() + "[<br/>" +
995             	
996 		              			"<b>Id</b> = " + String.valueOf(getId()
997  	) + " <br/> " + 
998 		              		
999 		              			"<b>Velocity</b> = " + String.valueOf(getVelocity()
1000  	) + " <br/> " + 
1001 		              		
1002 		              			"<b>Location</b> = " + String.valueOf(getLocation()
1003  	) + " <br/> " + 
1004 		              		
1005 		              			"<b>Holder</b> = " + String.valueOf(getHolder()
1006  	) + " <br/> " + 
1007 		              		
1008 		              			"<b>HolderTeam</b> = " + String.valueOf(getHolderTeam()
1009  	) + " <br/> " + 
1010 		              		
1011 		              			"<b>Visible</b> = " + String.valueOf(isVisible()
1012  	) + " <br/> " + 
1013 		              		
1014 		              			"<b>State</b> = " + String.valueOf(getState()
1015  	) + " <br/> " + 
1016 		              		
1017 				"<br/>]";     
1018 		}
1019  	
1020  		
1021  		// --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=all]) ---
1022         	
1023 		// --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=all]) ---
1024 		
1025 	    // --- Extra Java from XML BEGIN (extra/code/java/javapart/classcategory[@name=base+classtype[@name=message]) ---
1026 	        
1027 	    // --- Extra Java from XML END (extra/code/java/javapart/classcategory[@name=base+classtype[@name=message]) ---        	            	
1028  	
1029 		}
1030