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                Switch the bots weapon to another.
34                            Corresponding GameBots command is
35                            CHANGEWEAPON.
36                        
37               */
38              
39              public class
40              ChangeWeapon extends
41          CommandMessage
42  
43              {
44              
45              /**
46                Creates new instance of command ChangeWeapon.
47                Switch the bots weapon to another.Corresponding GameBots message for this command is
48                CHANGEWEAPON.
49                    @param Id 
50  			Unique Id of weapon to switch to. If you just send "Best" as
51  			Id, the server will pick your best weapon that still has
52  			ammo for you. Obtain Unique Id's from AIN messages. Be
53  			carefull, the weapon Id in bots inventory is different from
54  			the Ids of weapons that are lying in the map!
55  		
56                */
57               public ChangeWeapon(
58                  String Id) {
59                      
60                      this.Id = Id;
61                  
62                  }
63  
64              
65              		/**
66  		             Creates new instance of command ChangeWeapon.
67  		             Switch the bots weapon to another.Corresponding GameBots message for this command is
68  		             CHANGEWEAPON.
69  		             <p></p>WARNING: this is empty-command constructor, you have to use setters to fill it up!
70  		             */
71              		public  ChangeWeapon() {
72              		}
73              	
74  
75              /////// Properties BEGIN
76              
77          /**
78          
79  			Unique Id of weapon to switch to. If you just send "Best" as
80  			Id, the server will pick your best weapon that still has
81  			ammo for you. Obtain Unique Id's from AIN messages. Be
82  			carefull, the weapon Id in bots inventory is different from
83  			the Ids of weapons that are lying in the map!
84  		 */
85          protected
86           String Id =
87          	null;
88  
89          
90          /**
91          
92  			Unique Id of weapon to switch to. If you just send "Best" as
93  			Id, the server will pick your best weapon that still has
94  			ammo for you. Obtain Unique Id's from AIN messages. Be
95  			carefull, the weapon Id in bots inventory is different from
96  			the Ids of weapons that are lying in the map!
97  		 */
98          public
99          String getId() {
100             return
101          Id;
102         }
103         
104 
105         
106             /**
107         
108 			Unique Id of weapon to switch to. If you just send "Best" as
109 			Id, the server will pick your best weapon that still has
110 			ammo for you. Obtain Unique Id's from AIN messages. Be
111 			carefull, the weapon Id in bots inventory is different from
112 			the Ids of weapons that are lying in the map!
113 		 */
114         public ChangeWeapon setId(String Id) {
115             this.Id = Id;
116             return this;
117             }
118        
119             /////// Properties END
120 
121             /////// Extra Java code BEGIN
122 
123             	/////// Additional code from xslt BEGIN
124             		
125 
126 
127             	/////// Additional code from xslt END
128 
129 	            /////// Extra Java from XML BEGIN
130             		
131             	/////// Extra Java from XML END
132 
133             /////// Extra Java code END
134 
135             
136 
137             /**
138               * Cloning constructor.
139               */
140              public ChangeWeapon(ChangeWeapon original) {
141                 
142                      this.Id=original.Id;
143                 
144              }
145 
146              
147 
148                  
149             public String toString() {
150                 return
151                 
152                     	toMessage();
153                     
154              }
155 
156              public String toHtmlString() {
157                 return super.toString() +
158             
159             "<b>Id</b> : " +
160             String.valueOf(Id) +
161             " <br/> " +
162              "";
163              }
164 
165              
166              
167              	 public String toMessage() {
168               		StringBuffer buf = new StringBuffer();
169               		buf.append("CHANGEWEAPON");
170               		
171 		    					if (Id != null) {
172 		    						buf.append(" {Id " + Id + "}");
173 		    					}
174 		    				
175             		return buf.toString();
176             }
177              
178              }
179 
180