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 ADDINV.
15   		 *
16   		 * 
17  		We can add custom inventory for specified bot. This command can
18  		be issued also by bot on the bot itself (in this case Id
19  		attribute is not parsed). Issuing by bot is allowed just when
20  		the game has allowed cheating (bAllowCheats = True in GameBots2004.ini
21  		file).
22  	
23           */
24   	public class AddInventory 
25  		extends CommandMessage
26  	        {
27  	        	
28  		        
29      	/** Example how the message looks like - used during parser tests. */
30      	public static final String PROTOTYPE =
31      		" {Id unreal_id}  {Type text} ";
32      
33  		/**
34  		 * Creates new instance of command AddInventory.
35  		 * 
36  		We can add custom inventory for specified bot. This command can
37  		be issued also by bot on the bot itself (in this case Id
38  		attribute is not parsed). Issuing by bot is allowed just when
39  		the game has allowed cheating (bAllowCheats = True in GameBots2004.ini
40  		file).
41  	
42  		 * Corresponding GameBots message for this command is
43  		 * ADDINV.
44  		 *
45  		 * 
46  		 *    @param Id 
47  			Id of the target bot. Is used just when sending command to
48  			the server. If sending command to the bot Id is ignored and
49  			ADDINV command is executed on the bot (if bAllowCheats ==
50  			True).
51  		
52  		 *    @param Type 
53  			Class of the item we want to add. Must be pickup class (e.g.
54  			xWeapons.FlakCannonPickup).
55  		
56  		 */
57  		public AddInventory(
58  			UnrealId Id,  String Type
59  		) {
60  			
61  				this.Id = Id;
62              
63  				this.Type = Type;
64              
65  		}
66  
67  		
68  			/**
69  			 * Creates new instance of command AddInventory.
70  			 * 
71  		We can add custom inventory for specified bot. This command can
72  		be issued also by bot on the bot itself (in this case Id
73  		attribute is not parsed). Issuing by bot is allowed just when
74  		the game has allowed cheating (bAllowCheats = True in GameBots2004.ini
75  		file).
76  	
77  			 * Corresponding GameBots message for this command is
78  			 * ADDINV.
79  			 * <p></p>
80  			 * WARNING: this is empty-command constructor, you have to use setters to fill it up with data that should be sent to GameBots2004!
81  		     */
82  		    public AddInventory() {
83  		    }
84  			
85  		
86  		/**
87  		 * Cloning constructor.
88  		 *
89  		 * @param original
90  		 */
91  		public AddInventory(AddInventory original) {
92  		   
93  		        this.Id = original.Id;
94  		   
95  		        this.Type = original.Type;
96  		   
97  		}
98      
99  	        /**
100 	        
101 			Id of the target bot. Is used just when sending command to
102 			the server. If sending command to the bot Id is ignored and
103 			ADDINV command is executed on the bot (if bAllowCheats ==
104 			True).
105 		 
106 	        */
107 	        protected
108 	         UnrealId Id =
109 	       	
110 	        		null
111 	        	;
112 	
113 	        
114 	        
115  		/**
116          * 
117 			Id of the target bot. Is used just when sending command to
118 			the server. If sending command to the bot Id is ignored and
119 			ADDINV command is executed on the bot (if bAllowCheats ==
120 			True).
121 		 
122          */
123         public UnrealId getId()
124  	
125 	        {
126 	            return
127 	        	 Id;
128 	        }
129 	        
130 	        
131 	        
132  		
133  		/**
134          * 
135 			Id of the target bot. Is used just when sending command to
136 			the server. If sending command to the bot Id is ignored and
137 			ADDINV command is executed on the bot (if bAllowCheats ==
138 			True).
139 		 
140          */
141         public AddInventory 
142         setId(UnrealId Id)
143  	
144 			{
145 				this.Id = Id;
146 				return this;
147 			}
148 		
149 	        /**
150 	        
151 			Class of the item we want to add. Must be pickup class (e.g.
152 			xWeapons.FlakCannonPickup).
153 		 
154 	        */
155 	        protected
156 	         String Type =
157 	       	
158 	        		null
159 	        	;
160 	
161 	        
162 	        
163  		/**
164          * 
165 			Class of the item we want to add. Must be pickup class (e.g.
166 			xWeapons.FlakCannonPickup).
167 		 
168          */
169         public String getType()
170  	
171 	        {
172 	            return
173 	        	 Type;
174 	        }
175 	        
176 	        
177 	        
178  		
179  		/**
180          * 
181 			Class of the item we want to add. Must be pickup class (e.g.
182 			xWeapons.FlakCannonPickup).
183 		 
184          */
185         public AddInventory 
186         setType(String Type)
187  	
188 			{
189 				this.Type = Type;
190 				return this;
191 			}
192 		
193  	    public String toString() {
194             return toMessage();
195         }
196  	
197  		public String toHtmlString() {
198 			return super.toString() + "[<br/>" +
199             	
200             	"<b>Id</b> = " +
201             	String.valueOf(getId()
202  	) +
203             	" <br/> " +
204             	
205             	"<b>Type</b> = " +
206             	String.valueOf(getType()
207  	) +
208             	" <br/> " +
209             	 
210             	"<br/>]"
211             ;
212 		}
213  	
214 		public String toMessage() {
215      		StringBuffer buf = new StringBuffer();
216      		buf.append("ADDINV");
217      		
218 						if (Id != null) {
219 							buf.append(" {Id " + Id.getStringId() + "}");
220 						}
221 					
222 						if (Type != null) {
223 							buf.append(" {Type " + Type + "}");
224 						}
225 					
226    			return buf.toString();
227    		}
228  	
229  		// --- Extra Java from XML BEGIN (extra/code/java)
230         	
231 		// --- Extra Java from XML END (extra/code/java)
232  	
233 	        }
234