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 THAT FILE INSTEAD OF THIS ONE.
7            
8            Use Ant task process-gb-messages after that to generate .java files again.
9            
10           IMPORTANT END !!!
11          */
12   	package cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands;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.*;
13   		/**
14   		 * Representation of the GameBots2004 command GIVEINV.
15   		 *
16   		 * 
17  		Gives inventory from one bot to another. Bot can give just owned
18  		items. (in his inventory chain). He can't give weapon he is
19  		wielding right now. This command is not fully tested yet and has
20  		issues.
21  	
22           */
23   	public class GiveInventory 
24  		extends CommandMessage
25  	        {
26  	        	
27  		        
28      	/** Example how the message looks like - used during parser tests. */
29      	public static final String PROTOTYPE =
30      		" {Target unreal_id}  {ItemId text} ";
31      
32  		/**
33  		 * Creates new instance of command GiveInventory.
34  		 * 
35  		Gives inventory from one bot to another. Bot can give just owned
36  		items. (in his inventory chain). He can't give weapon he is
37  		wielding right now. This command is not fully tested yet and has
38  		issues.
39  	
40  		 * Corresponding GameBots message for this command is
41  		 * GIVEINV.
42  		 *
43  		 * 
44  		 *    @param Target Id of the receiving bot.
45  		 *    @param ItemId 
46  			Id of the item in the inventory chain of the giver.
47  		
48  		 */
49  		public GiveInventory(
50  			UnrealId Target,  String ItemId
51  		) {
52  			
53  				this.Target = Target;
54              
55  				this.ItemId = ItemId;
56              
57  		}
58  
59  		
60  			/**
61  			 * Creates new instance of command GiveInventory.
62  			 * 
63  		Gives inventory from one bot to another. Bot can give just owned
64  		items. (in his inventory chain). He can't give weapon he is
65  		wielding right now. This command is not fully tested yet and has
66  		issues.
67  	
68  			 * Corresponding GameBots message for this command is
69  			 * GIVEINV.
70  			 * <p></p>
71  			 * WARNING: this is empty-command constructor, you have to use setters to fill it up with data that should be sent to GameBots2004!
72  		     */
73  		    public GiveInventory() {
74  		    }
75  			
76  		
77  		/**
78  		 * Cloning constructor.
79  		 *
80  		 * @param original
81  		 */
82  		public GiveInventory(GiveInventory original) {
83  		   
84  		        this.Target = original.Target;
85  		   
86  		        this.ItemId = original.ItemId;
87  		   
88  		}
89      
90  	        /**
91  	        Id of the receiving bot. 
92  	        */
93  	        protected
94  	         UnrealId Target =
95  	       	
96  	        		null
97  	        	;
98  	
99  	        
100 	        
101  		/**
102          * Id of the receiving bot. 
103          */
104         public UnrealId getTarget()
105  	
106 	        {
107 	            return
108 	        	 Target;
109 	        }
110 	        
111 	        
112 	        
113  		
114  		/**
115          * Id of the receiving bot. 
116          */
117         public GiveInventory 
118         setTarget(UnrealId Target)
119  	
120 			{
121 				this.Target = Target;
122 				return this;
123 			}
124 		
125 	        /**
126 	        
127 			Id of the item in the inventory chain of the giver.
128 		 
129 	        */
130 	        protected
131 	         String ItemId =
132 	       	
133 	        		null
134 	        	;
135 	
136 	        
137 	        
138  		/**
139          * 
140 			Id of the item in the inventory chain of the giver.
141 		 
142          */
143         public String getItemId()
144  	
145 	        {
146 	            return
147 	        	 ItemId;
148 	        }
149 	        
150 	        
151 	        
152  		
153  		/**
154          * 
155 			Id of the item in the inventory chain of the giver.
156 		 
157          */
158         public GiveInventory 
159         setItemId(String ItemId)
160  	
161 			{
162 				this.ItemId = ItemId;
163 				return this;
164 			}
165 		
166  	    public String toString() {
167             return toMessage();
168         }
169  	
170  		public String toHtmlString() {
171 			return super.toString() + "[<br/>" +
172             	
173             	"<b>Target</b> = " +
174             	String.valueOf(getTarget()
175  	) +
176             	" <br/> " +
177             	
178             	"<b>ItemId</b> = " +
179             	String.valueOf(getItemId()
180  	) +
181             	" <br/> " +
182             	 
183             	"<br/>]"
184             ;
185 		}
186  	
187 		public String toMessage() {
188      		StringBuffer buf = new StringBuffer();
189      		buf.append("GIVEINV");
190      		
191 						if (Target != null) {
192 							buf.append(" {Target " + Target.getStringId() + "}");
193 						}
194 					
195 						if (ItemId != null) {
196 							buf.append(" {ItemId " + ItemId + "}");
197 						}
198 					
199    			return buf.toString();
200    		}
201  	
202  		// --- Extra Java from XML BEGIN (extra/code/java)
203         	
204 		// --- Extra Java from XML END (extra/code/java)
205  	
206 	        }
207