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. Bot changed weapon. Possibly as a result
35  		of a command sent by you. Here we will get the new weapon - the weapon the
36          bot has changed to.
37  	
38                            Corresponding GameBots message is
39                            CWP.
40                        
41               */
42              
43              public class
44              ChangedWeapon
45                      extends GBEvent
46                  
47  	            	implements IWorldEvent, IWorldChangeEvent
48  
49              {
50              
51              /**
52                Creates new instance of command ChangedWeapon.
53                
54  		Asynchronous message. Bot changed weapon. Possibly as a result
55  		of a command sent by you. Here we will get the new weapon - the weapon the
56          bot has changed to.
57  	Corresponding GameBots message for this command is
58                .
59                    @param Id 
60  			Unique Id of new weapon, based on the inventory weapon's
61  			name (this is different from the Id of the weapon that can
62  			be picked up in the map).
63  		
64                    @param PrimaryAmmo 
65  			Holding current primary ammo of the new weapon.
66  		
67                    @param SecondaryAmmo 
68  			Holding current secondary ammo of the new weapon.
69  		
70                    @param Type 
71  			A string representing the type of the weapon.
72  		
73                */
74               public ChangedWeapon(
75                  String Id,  int PrimaryAmmo,  int SecondaryAmmo,  String Type) {
76                      
77                      this.Id = Id;
78                  
79                      this.PrimaryAmmo = PrimaryAmmo;
80                  
81                      this.SecondaryAmmo = SecondaryAmmo;
82                  
83                      this.Type = Type;
84                  
85                  }
86  
87              
88      	/** Example how the message looks like - used during parser tests. */
89      	public static final String PROTOTYPE =
90      		"CWP {Id text} {PrimaryAmmo 0} {SecondaryAmmo 0} {Type text}";
91      
92  
93              /////// Properties BEGIN
94              
95          /**
96          
97  			Unique Id of new weapon, based on the inventory weapon's
98  			name (this is different from the Id of the weapon that can
99  			be picked up in the map).
100 		 */
101         protected
102          String Id =
103         	null;
104 
105         
106         /**
107         
108 			Unique Id of new weapon, based on the inventory weapon's
109 			name (this is different from the Id of the weapon that can
110 			be picked up in the map).
111 		 */
112         public
113         String getId() {
114             return
115          Id;
116         }
117         
118 
119         
120         /**
121         
122 			Holding current primary ammo of the new weapon.
123 		 */
124         protected
125          int PrimaryAmmo =
126         	0;
127 
128         
129         /**
130         
131 			Holding current primary ammo of the new weapon.
132 		 */
133         public
134         int getPrimaryAmmo() {
135             return
136          PrimaryAmmo;
137         }
138         
139 
140         
141         /**
142         
143 			Holding current secondary ammo of the new weapon.
144 		 */
145         protected
146          int SecondaryAmmo =
147         	0;
148 
149         
150         /**
151         
152 			Holding current secondary ammo of the new weapon.
153 		 */
154         public
155         int getSecondaryAmmo() {
156             return
157          SecondaryAmmo;
158         }
159         
160 
161         
162         /**
163         
164 			A string representing the type of the weapon.
165 		 */
166         protected
167          String Type =
168         	null;
169 
170         
171         /**
172         
173 			A string representing the type of the weapon.
174 		 */
175         public
176         String getType() {
177             return
178          Type;
179         }
180         
181 
182         
183             /////// Properties END
184 
185             /////// Extra Java code BEGIN
186 
187             	/////// Additional code from xslt BEGIN
188             		
189        					public long getSimTime() {
190        						// NOT IMPLEMENTED FOR UDK
191        						return 0;
192        					}
193             		
194 
195 
196             	/////// Additional code from xslt END
197 
198 	            /////// Extra Java from XML BEGIN
199             		
200             	/////// Extra Java from XML END
201 
202             /////// Extra Java code END
203 
204             
205 
206             /**
207               * Cloning constructor.
208               */
209              public ChangedWeapon(ChangedWeapon original) {
210                 
211                      this.Id=original.Id;
212                 
213                      this.PrimaryAmmo=original.PrimaryAmmo;
214                 
215                      this.SecondaryAmmo=original.SecondaryAmmo;
216                 
217                      this.Type=original.Type;
218                 
219              }
220 
221              
222                  /**
223                   * Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
224                   */
225 	             public ChangedWeapon() {
226 	             }
227              
228 
229                  
230             public String toString() {
231                 return
232                 
233                 		super.toString() + " | " +
234                 		
235 				               "Id = " +
236 				               String.valueOf(Id) + " | " +
237 				            
238 				               "PrimaryAmmo = " +
239 				               String.valueOf(PrimaryAmmo) + " | " +
240 				            
241 				               "SecondaryAmmo = " +
242 				               String.valueOf(SecondaryAmmo) + " | " +
243 				            
244 				               "Type = " +
245 				               String.valueOf(Type) + " | " +
246 				             "";
247                 	
248              }
249 
250              public String toHtmlString() {
251                 return super.toString() +
252             
253             "<b>Id</b> : " +
254             String.valueOf(Id) +
255             " <br/> " +
256             
257             "<b>PrimaryAmmo</b> : " +
258             String.valueOf(PrimaryAmmo) +
259             " <br/> " +
260             
261             "<b>SecondaryAmmo</b> : " +
262             String.valueOf(SecondaryAmmo) +
263             " <br/> " +
264             
265             "<b>Type</b> : " +
266             String.valueOf(Type) +
267             " <br/> " +
268              "";
269              }
270 
271              
272              
273              }
274 
275