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