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 JUMP.
15   		 *
16   		 * Causes bot to jump.
17           */
18   	public class Jump 
19  		extends CommandMessage
20  	        {
21  	        	
22  		        
23      	/** Example how the message looks like - used during parser tests. */
24      	public static final String PROTOTYPE =
25      		" {DoubleJump False}  {Delay 0}  {Force 0} ";
26      
27  		/**
28  		 * Creates new instance of command Jump.
29  		 * Causes bot to jump.
30  		 * Corresponding GameBots message for this command is
31  		 * JUMP.
32  		 *
33  		 * 
34  		 *    @param DoubleJump 
35  			If set to True will cause the bot to perform double jump.
36  		
37  		 *    @param Delay 
38  			After time specified here, the bot performs second jump of a double jump (if DoubleJump is true). Time is in seconds. If not specified and DoubleJump is true, 0.5 seconds will be used.
39  		
40  		 *    @param Force 
41  			Force vector specifying how big the jump should be. Can't be set more than bot JumpZ variable for single jump and 2 * JumpZ variable for doube jump. Default value of JumpZ is 340 ut units (for UT2004). If not specified, JumpZ value will be used. If not specified and DoubleJump is true, 2 * JumpZ value will be used.
42  		
43  		 */
44  		public Jump(
45  			Boolean DoubleJump,  Double Delay,  Double Force
46  		) {
47  			
48  				this.DoubleJump = DoubleJump;
49              
50  				this.Delay = Delay;
51              
52  				this.Force = Force;
53              
54  		}
55  
56  		
57  			/**
58  			 * Creates new instance of command Jump.
59  			 * Causes bot to jump.
60  			 * Corresponding GameBots message for this command is
61  			 * JUMP.
62  			 * <p></p>
63  			 * WARNING: this is empty-command constructor, you have to use setters to fill it up with data that should be sent to GameBots2004!
64  		     */
65  		    public Jump() {
66  		    }
67  			
68  		
69  		/**
70  		 * Cloning constructor.
71  		 *
72  		 * @param original
73  		 */
74  		public Jump(Jump original) {
75  		   
76  		        this.DoubleJump = original.DoubleJump;
77  		   
78  		        this.Delay = original.Delay;
79  		   
80  		        this.Force = original.Force;
81  		   
82  		}
83      
84  	        /**
85  	        
86  			If set to True will cause the bot to perform double jump.
87  		 
88  	        */
89  	        protected
90  	         Boolean DoubleJump =
91  	       	
92  	        		null
93  	        	;
94  	
95  	        
96  	        
97   		/**
98           * 
99  			If set to True will cause the bot to perform double jump.
100 		 
101          */
102         public Boolean isDoubleJump()
103  	
104 	        {
105 	            return
106 	        	 DoubleJump;
107 	        }
108 	        
109 	        
110 	        
111  		
112  		/**
113          * 
114 			If set to True will cause the bot to perform double jump.
115 		 
116          */
117         public Jump 
118         setDoubleJump(Boolean DoubleJump)
119  	
120 			{
121 				this.DoubleJump = DoubleJump;
122 				return this;
123 			}
124 		
125 	        /**
126 	        
127 			After time specified here, the bot performs second jump of a double jump (if DoubleJump is true). Time is in seconds. If not specified and DoubleJump is true, 0.5 seconds will be used.
128 		 
129 	        */
130 	        protected
131 	         Double Delay =
132 	       	
133 	        		null
134 	        	;
135 	
136 	        
137 	        
138  		/**
139          * 
140 			After time specified here, the bot performs second jump of a double jump (if DoubleJump is true). Time is in seconds. If not specified and DoubleJump is true, 0.5 seconds will be used.
141 		 
142          */
143         public Double getDelay()
144  	
145 	        {
146 	            return
147 	        	 Delay;
148 	        }
149 	        
150 	        
151 	        
152  		
153  		/**
154          * 
155 			After time specified here, the bot performs second jump of a double jump (if DoubleJump is true). Time is in seconds. If not specified and DoubleJump is true, 0.5 seconds will be used.
156 		 
157          */
158         public Jump 
159         setDelay(Double Delay)
160  	
161 			{
162 				this.Delay = Delay;
163 				return this;
164 			}
165 		
166 	        /**
167 	        
168 			Force vector specifying how big the jump should be. Can't be set more than bot JumpZ variable for single jump and 2 * JumpZ variable for doube jump. Default value of JumpZ is 340 ut units (for UT2004). If not specified, JumpZ value will be used. If not specified and DoubleJump is true, 2 * JumpZ value will be used.
169 		 
170 	        */
171 	        protected
172 	         Double Force =
173 	       	
174 	        		null
175 	        	;
176 	
177 	        
178 	        
179  		/**
180          * 
181 			Force vector specifying how big the jump should be. Can't be set more than bot JumpZ variable for single jump and 2 * JumpZ variable for doube jump. Default value of JumpZ is 340 ut units (for UT2004). If not specified, JumpZ value will be used. If not specified and DoubleJump is true, 2 * JumpZ value will be used.
182 		 
183          */
184         public Double getForce()
185  	
186 	        {
187 	            return
188 	        	 Force;
189 	        }
190 	        
191 	        
192 	        
193  		
194  		/**
195          * 
196 			Force vector specifying how big the jump should be. Can't be set more than bot JumpZ variable for single jump and 2 * JumpZ variable for doube jump. Default value of JumpZ is 340 ut units (for UT2004). If not specified, JumpZ value will be used. If not specified and DoubleJump is true, 2 * JumpZ value will be used.
197 		 
198          */
199         public Jump 
200         setForce(Double Force)
201  	
202 			{
203 				this.Force = Force;
204 				return this;
205 			}
206 		
207  	    public String toString() {
208             return toMessage();
209         }
210  	
211  		public String toHtmlString() {
212 			return super.toString() + "[<br/>" +
213             	
214             	"<b>DoubleJump</b> = " +
215             	String.valueOf(isDoubleJump()
216  	) +
217             	" <br/> " +
218             	
219             	"<b>Delay</b> = " +
220             	String.valueOf(getDelay()
221  	) +
222             	" <br/> " +
223             	
224             	"<b>Force</b> = " +
225             	String.valueOf(getForce()
226  	) +
227             	" <br/> " +
228             	 
229             	"<br/>]"
230             ;
231 		}
232  	
233 		public String toMessage() {
234      		StringBuffer buf = new StringBuffer();
235      		buf.append("JUMP");
236      		
237 						if (DoubleJump != null) {
238 							buf.append(" {DoubleJump " + DoubleJump + "}");
239 						}
240 					
241 						if (Delay != null) {
242 							buf.append(" {Delay " + Delay + "}");
243 						}
244 					
245 						if (Force != null) {
246 							buf.append(" {Force " + Force + "}");
247 						}
248 					
249    			return buf.toString();
250    		}
251  	
252  		// --- Extra Java from XML BEGIN (extra/code/java)
253         	
254 		// --- Extra Java from XML END (extra/code/java)
255  	
256 	        }
257