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 CHANGEWEAPON.
15   		 *
16   		 * Switch the bots weapon to another.
17           */
18   	public class ChangeWeapon 
19  		extends CommandMessage
20  	        {
21  	        	
22  		        
23      	/** Example how the message looks like - used during parser tests. */
24      	public static final String PROTOTYPE =
25      		" {Id text} ";
26      
27  		/**
28  		 * Creates new instance of command ChangeWeapon.
29  		 * Switch the bots weapon to another.
30  		 * Corresponding GameBots message for this command is
31  		 * CHANGEWEAPON.
32  		 *
33  		 * 
34  		 *    @param Id 
35  			Unique Id of weapon to switch to. If you just send "Best" as
36  			Id, the server will pick your best weapon that still has
37  			ammo for you. Obtain Unique Id's from AIN messages. Be
38  			carefull, the weapon Id in bots inventory is different from
39  			the Ids of weapons that are lying in the map!
40  		
41  		 */
42  		public ChangeWeapon(
43  			String Id
44  		) {
45  			
46  				this.Id = Id;
47              
48  		}
49  
50  		
51  			/**
52  			 * Creates new instance of command ChangeWeapon.
53  			 * Switch the bots weapon to another.
54  			 * Corresponding GameBots message for this command is
55  			 * CHANGEWEAPON.
56  			 * <p></p>
57  			 * WARNING: this is empty-command constructor, you have to use setters to fill it up with data that should be sent to GameBots2004!
58  		     */
59  		    public ChangeWeapon() {
60  		    }
61  			
62  		
63  		/**
64  		 * Cloning constructor.
65  		 *
66  		 * @param original
67  		 */
68  		public ChangeWeapon(ChangeWeapon original) {
69  		   
70  		        this.Id = original.Id;
71  		   
72  		}
73      
74  	        /**
75  	        
76  			Unique Id of weapon to switch to. If you just send "Best" as
77  			Id, the server will pick your best weapon that still has
78  			ammo for you. Obtain Unique Id's from AIN messages. Be
79  			carefull, the weapon Id in bots inventory is different from
80  			the Ids of weapons that are lying in the map!
81  		 
82  	        */
83  	        protected
84  	         String Id =
85  	       	
86  	        		null
87  	        	;
88  	
89  	        
90  	        
91   		/**
92           * 
93  			Unique Id of weapon to switch to. If you just send "Best" as
94  			Id, the server will pick your best weapon that still has
95  			ammo for you. Obtain Unique Id's from AIN messages. Be
96  			carefull, the weapon Id in bots inventory is different from
97  			the Ids of weapons that are lying in the map!
98  		 
99           */
100         public String getId()
101  	
102 	        {
103 	            return
104 	        	 Id;
105 	        }
106 	        
107 	        
108 	        
109  		
110  		/**
111          * 
112 			Unique Id of weapon to switch to. If you just send "Best" as
113 			Id, the server will pick your best weapon that still has
114 			ammo for you. Obtain Unique Id's from AIN messages. Be
115 			carefull, the weapon Id in bots inventory is different from
116 			the Ids of weapons that are lying in the map!
117 		 
118          */
119         public ChangeWeapon 
120         setId(String Id)
121  	
122 			{
123 				this.Id = Id;
124 				return this;
125 			}
126 		
127  	    public String toString() {
128             return toMessage();
129         }
130  	
131  		public String toHtmlString() {
132 			return super.toString() + "[<br/>" +
133             	
134             	"<b>Id</b> = " +
135             	String.valueOf(getId()
136  	) +
137             	" <br/> " +
138             	 
139             	"<br/>]"
140             ;
141 		}
142  	
143 		public String toMessage() {
144      		StringBuffer buf = new StringBuffer();
145      		buf.append("CHANGEWEAPON");
146      		
147 						if (Id != null) {
148 							buf.append(" {Id " + Id + "}");
149 						}
150 					
151    			return buf.toString();
152    		}
153  	
154  		// --- Extra Java from XML BEGIN (extra/code/java)
155         	
156 		// --- Extra Java from XML END (extra/code/java)
157  	
158 	        }
159