View Javadoc

1   
2               /**
3               IMPORTANT !!!
4   
5               DO NOT EDIT THIS FILE. IT IS GENERATED FROM approriate xml file in xmlresources/gbinfomessages 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.gbinfomessages;
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  		Asynchronous message. Sent when we get new weapon or ammunition
35  		for weapon we do not have yet. Sent just once per weapon type or
36  		per new ammunition type (notify new object in our inventory, NOT
37  		pickup). 
38  		The Id of the object (Inventory Id) here is different from the object that is lying on the 
39  		ground and represents this item in the map (Pickup id).
40  		If you want to listen to every item pickup use ItemPickedUp message!
41  	
42                            Corresponding GameBots message is
43                            AIN.
44                        
45               */
46              
47              public class
48              AddInventoryMsg
49                      extends GBEvent
50                  
51  	            	implements IWorldEvent, IWorldChangeEvent
52  
53              {
54              
55              /**
56                Creates new instance of command AddInventoryMsg.
57                
58  		Asynchronous message. Sent when we get new weapon or ammunition
59  		for weapon we do not have yet. Sent just once per weapon type or
60  		per new ammunition type (notify new object in our inventory, NOT
61  		pickup). 
62  		The Id of the object (Inventory Id) here is different from the object that is lying on the 
63  		ground and represents this item in the map (Pickup id).
64  		If you want to listen to every item pickup use ItemPickedUp message!
65  	Corresponding GameBots message for this command is
66                .
67                    @param Id 
68  			A unique Id for this inventory item, assigned by the game.
69  			Unique, but based on a string describing the item type.
70  		
71                    @param Type 
72  			A string representing type (inventory type) of the object.
73  		
74                    @param Descriptor 
75  			Descriptor of the item - according the ItemType you may cast this to various XYZDescriptor. 
76  		
77                    @param PickupType 
78  			We get this item if we pick up this pickup class in the map.
79  		
80                */
81               public AddInventoryMsg(
82                  UnrealId Id,  String Type,  ItemDescriptor Descriptor,  ItemType PickupType) {
83                      
84                      this.Id = Id;
85                  
86                      this.Type = Type;
87                  
88                      this.Descriptor = Descriptor;
89                  
90                      this.PickupType = PickupType;
91                  
92                  }
93  
94              
95      	/** Example how the message looks like - used during parser tests. */
96      	public static final String PROTOTYPE =
97      		"AIN {Id unreal_id} {Type text} {PickupType xWeapons.FlakCannonPickup}";
98      
99  
100             /////// Properties BEGIN
101             
102         /**
103         
104 			A unique Id for this inventory item, assigned by the game.
105 			Unique, but based on a string describing the item type.
106 		 */
107         protected
108          UnrealId Id =
109         	null;
110 
111         
112         /**
113         
114 			A unique Id for this inventory item, assigned by the game.
115 			Unique, but based on a string describing the item type.
116 		 */
117         public
118         UnrealId getId() {
119             return
120          Id;
121         }
122         
123 
124         
125         /**
126         
127 			A string representing type (inventory type) of the object.
128 		 */
129         protected
130          String Type =
131         	null;
132 
133         
134         /**
135         
136 			A string representing type (inventory type) of the object.
137 		 */
138         public
139         String getType() {
140             return
141          Type;
142         }
143         
144 
145         
146         /**
147         
148 			Descriptor of the item - according the ItemType you may cast this to various XYZDescriptor. 
149 		 */
150         protected
151          ItemDescriptor Descriptor =
152         	null;
153 
154         
155         /**
156         
157 			Descriptor of the item - according the ItemType you may cast this to various XYZDescriptor. 
158 		 */
159         public
160         ItemDescriptor getDescriptor() {
161             return
162          Descriptor;
163         }
164         
165 
166         
167         /**
168         
169 			We get this item if we pick up this pickup class in the map.
170 		 */
171         protected
172          ItemType PickupType =
173         	null;
174 
175         
176         /**
177         
178 			We get this item if we pick up this pickup class in the map.
179 		 */
180         public
181         ItemType getPickupType() {
182             return
183          PickupType;
184         }
185         
186 
187         
188             /////// Properties END
189 
190             /////// Extra Java code BEGIN
191 
192             	/////// Additional code from xslt BEGIN
193             		
194        					public long getSimTime() {
195        						// NOT IMPLEMENTED FOR UDK
196        						return 0;
197        					}
198             		
199 
200 
201             	/////// Additional code from xslt END
202 
203 	            /////// Extra Java from XML BEGIN
204             		
205             	/////// Extra Java from XML END
206 
207             /////// Extra Java code END
208 
209             
210 
211             /**
212               * Cloning constructor.
213               */
214              public AddInventoryMsg(AddInventoryMsg original) {
215                 
216                      this.Id=original.Id;
217                 
218                      this.Type=original.Type;
219                 
220                      this.Descriptor=original.Descriptor;
221                 
222                      this.PickupType=original.PickupType;
223                 
224              }
225 
226              
227                  /**
228                   * Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
229                   */
230 	             public AddInventoryMsg() {
231 	             }
232              
233 
234                  
235             public String toString() {
236                 return
237                 
238                 		super.toString() + " | " +
239                 		
240 				               "Id = " +
241 				               String.valueOf(Id) + " | " +
242 				            
243 				               "Type = " +
244 				               String.valueOf(Type) + " | " +
245 				            
246 				               "PickupType = " +
247 				               String.valueOf(PickupType) + " | " +
248 				             "";
249                 	
250              }
251 
252              public String toHtmlString() {
253                 return super.toString() +
254             
255             "<b>Id</b> : " +
256             String.valueOf(Id) +
257             " <br/> " +
258             
259             "<b>Type</b> : " +
260             String.valueOf(Type) +
261             " <br/> " +
262             
263             "<b>Descriptor</b> : " +
264             String.valueOf(Descriptor) +
265             " <br/> " +
266             
267             "<b>PickupType</b> : " +
268             String.valueOf(PickupType) +
269             " <br/> " +
270              "";
271              }
272 
273              
274              
275              }
276 
277