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