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 CHATTR.
15   		 *
16   		 * 
17  		Will change the specified attribute of the bot. This command can
18  		be issued also by bot on the bot itself (in this case Id
19  		attribute is not parsed). Issuing by bot is allowed just when
20  		the game has allowed cheating (bAllowCheats = True in GameBots2004.ini
21  		file).
22  	
23           */
24   	public class ChangeAttribute 
25  		extends CommandMessage
26  	        {
27  	        	
28  		        
29      	/** Example how the message looks like - used during parser tests. */
30      	public static final String PROTOTYPE =
31      		" {Id unreal_id}  {Health 0}  {Adrenaline 0} ";
32      
33  		/**
34  		 * Creates new instance of command ChangeAttribute.
35  		 * 
36  		Will change the specified attribute of the bot. This command can
37  		be issued also by bot on the bot itself (in this case Id
38  		attribute is not parsed). Issuing by bot is allowed just when
39  		the game has allowed cheating (bAllowCheats = True in GameBots2004.ini
40  		file).
41  	
42  		 * Corresponding GameBots message for this command is
43  		 * CHATTR.
44  		 *
45  		 * 
46  		 *    @param Id 
47  			Id of the target bot. Not used if sent as a command for the
48  			bot.
49  		
50  		 *    @param Health Sets the bot health. Maximum health level is 199 in UT2004. 
51  		 *    @param Adrenaline Sets the bot adrenaline. From 0 to 100.
52  		 */
53  		public ChangeAttribute(
54  			UnrealId Id,  Integer Health,  Integer Adrenaline
55  		) {
56  			
57  				this.Id = Id;
58              
59  				this.Health = Health;
60              
61  				this.Adrenaline = Adrenaline;
62              
63  		}
64  
65  		
66  			/**
67  			 * Creates new instance of command ChangeAttribute.
68  			 * 
69  		Will change the specified attribute of the bot. This command can
70  		be issued also by bot on the bot itself (in this case Id
71  		attribute is not parsed). Issuing by bot is allowed just when
72  		the game has allowed cheating (bAllowCheats = True in GameBots2004.ini
73  		file).
74  	
75  			 * Corresponding GameBots message for this command is
76  			 * CHATTR.
77  			 * <p></p>
78  			 * WARNING: this is empty-command constructor, you have to use setters to fill it up with data that should be sent to GameBots2004!
79  		     */
80  		    public ChangeAttribute() {
81  		    }
82  			
83  		
84  		/**
85  		 * Cloning constructor.
86  		 *
87  		 * @param original
88  		 */
89  		public ChangeAttribute(ChangeAttribute original) {
90  		   
91  		        this.Id = original.Id;
92  		   
93  		        this.Health = original.Health;
94  		   
95  		        this.Adrenaline = original.Adrenaline;
96  		   
97  		}
98      
99  	        /**
100 	        
101 			Id of the target bot. Not used if sent as a command for the
102 			bot.
103 		 
104 	        */
105 	        protected
106 	         UnrealId Id =
107 	       	
108 	        		null
109 	        	;
110 	
111 	        
112 	        
113  		/**
114          * 
115 			Id of the target bot. Not used if sent as a command for the
116 			bot.
117 		 
118          */
119         public UnrealId getId()
120  	
121 	        {
122 	            return
123 	        	 Id;
124 	        }
125 	        
126 	        
127 	        
128  		
129  		/**
130          * 
131 			Id of the target bot. Not used if sent as a command for the
132 			bot.
133 		 
134          */
135         public ChangeAttribute 
136         setId(UnrealId Id)
137  	
138 			{
139 				this.Id = Id;
140 				return this;
141 			}
142 		
143 	        /**
144 	        Sets the bot health. Maximum health level is 199 in UT2004.  
145 	        */
146 	        protected
147 	         Integer Health =
148 	       	
149 	        		null
150 	        	;
151 	
152 	        
153 	        
154  		/**
155          * Sets the bot health. Maximum health level is 199 in UT2004.  
156          */
157         public Integer getHealth()
158  	
159 	        {
160 	            return
161 	        	 Health;
162 	        }
163 	        
164 	        
165 	        
166  		
167  		/**
168          * Sets the bot health. Maximum health level is 199 in UT2004.  
169          */
170         public ChangeAttribute 
171         setHealth(Integer Health)
172  	
173 			{
174 				this.Health = Health;
175 				return this;
176 			}
177 		
178 	        /**
179 	        Sets the bot adrenaline. From 0 to 100. 
180 	        */
181 	        protected
182 	         Integer Adrenaline =
183 	       	
184 	        		null
185 	        	;
186 	
187 	        
188 	        
189  		/**
190          * Sets the bot adrenaline. From 0 to 100. 
191          */
192         public Integer getAdrenaline()
193  	
194 	        {
195 	            return
196 	        	 Adrenaline;
197 	        }
198 	        
199 	        
200 	        
201  		
202  		/**
203          * Sets the bot adrenaline. From 0 to 100. 
204          */
205         public ChangeAttribute 
206         setAdrenaline(Integer Adrenaline)
207  	
208 			{
209 				this.Adrenaline = Adrenaline;
210 				return this;
211 			}
212 		
213  	    public String toString() {
214             return toMessage();
215         }
216  	
217  		public String toHtmlString() {
218 			return super.toString() + "[<br/>" +
219             	
220             	"<b>Id</b> = " +
221             	String.valueOf(getId()
222  	) +
223             	" <br/> " +
224             	
225             	"<b>Health</b> = " +
226             	String.valueOf(getHealth()
227  	) +
228             	" <br/> " +
229             	
230             	"<b>Adrenaline</b> = " +
231             	String.valueOf(getAdrenaline()
232  	) +
233             	" <br/> " +
234             	 
235             	"<br/>]"
236             ;
237 		}
238  	
239 		public String toMessage() {
240      		StringBuffer buf = new StringBuffer();
241      		buf.append("CHATTR");
242      		
243 						if (Id != null) {
244 							buf.append(" {Id " + Id.getStringId() + "}");
245 						}
246 					
247 						if (Health != null) {
248 							buf.append(" {Health " + Health + "}");
249 						}
250 					
251 						if (Adrenaline != null) {
252 							buf.append(" {Adrenaline " + Adrenaline + "}");
253 						}
254 					
255    			return buf.toString();
256    		}
257  	
258  		// --- Extra Java from XML BEGIN (extra/code/java)
259         	
260 		// --- Extra Java from XML END (extra/code/java)
261  	
262 	        }
263