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. Maximum for JumpZ is 755, which is actually more than human player can do, but it needs to be that high in order to have safe
42  			navigation through jumping links.
43  		
44  		 */
45  		public Jump(
46  			Boolean DoubleJump,  Double Delay,  Double Force
47  		) {
48  			
49  				this.DoubleJump = DoubleJump;
50              
51  				this.Delay = Delay;
52              
53  				this.Force = Force;
54              
55  		}
56  
57  		
58  			/**
59  			 * Creates new instance of command Jump.
60  			 * Causes bot to jump.
61  			 * Corresponding GameBots message for this command is
62  			 * JUMP.
63  			 * <p></p>
64  			 * WARNING: this is empty-command constructor, you have to use setters to fill it up with data that should be sent to GameBots2004!
65  		     */
66  		    public Jump() {
67  		    }
68  			
69  		
70  		/**
71  		 * Cloning constructor.
72  		 *
73  		 * @param original
74  		 */
75  		public Jump(Jump original) {
76  		   
77  		        this.DoubleJump = original.DoubleJump;
78  		   
79  		        this.Delay = original.Delay;
80  		   
81  		        this.Force = original.Force;
82  		   
83  		}
84      
85  	        /**
86  	        
87  			If set to True will cause the bot to perform double jump.
88  		 
89  	        */
90  	        protected
91  	         Boolean DoubleJump =
92  	       	
93  	        		null
94  	        	;
95  	
96  	        
97  	        
98   		/**
99           * 
100 			If set to True will cause the bot to perform double jump.
101 		 
102          */
103         public Boolean isDoubleJump()
104  	
105 	        {
106 	            return
107 	        	 DoubleJump;
108 	        }
109 	        
110 	        
111 	        
112  		
113  		/**
114          * 
115 			If set to True will cause the bot to perform double jump.
116 		 
117          */
118         public Jump 
119         setDoubleJump(Boolean DoubleJump)
120  	
121 			{
122 				this.DoubleJump = DoubleJump;
123 				return this;
124 			}
125 		
126 	        /**
127 	        
128 			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.
129 		 
130 	        */
131 	        protected
132 	         Double Delay =
133 	       	
134 	        		null
135 	        	;
136 	
137 	        
138 	        
139  		/**
140          * 
141 			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.
142 		 
143          */
144         public Double getDelay()
145  	
146 	        {
147 	            return
148 	        	 Delay;
149 	        }
150 	        
151 	        
152 	        
153  		
154  		/**
155          * 
156 			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.
157 		 
158          */
159         public Jump 
160         setDelay(Double Delay)
161  	
162 			{
163 				this.Delay = Delay;
164 				return this;
165 			}
166 		
167 	        /**
168 	        
169 			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. Maximum for JumpZ is 755, which is actually more than human player can do, but it needs to be that high in order to have safe
170 			navigation through jumping links.
171 		 
172 	        */
173 	        protected
174 	         Double Force =
175 	       	
176 	        		null
177 	        	;
178 	
179 	        
180 	        
181  		/**
182          * 
183 			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. Maximum for JumpZ is 755, which is actually more than human player can do, but it needs to be that high in order to have safe
184 			navigation through jumping links.
185 		 
186          */
187         public Double getForce()
188  	
189 	        {
190 	            return
191 	        	 Force;
192 	        }
193 	        
194 	        
195 	        
196  		
197  		/**
198          * 
199 			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. Maximum for JumpZ is 755, which is actually more than human player can do, but it needs to be that high in order to have safe
200 			navigation through jumping links.
201 		 
202          */
203         public Jump 
204         setForce(Double Force)
205  	
206 			{
207 				this.Force = Force;
208 				return this;
209 			}
210 		
211  	    public String toString() {
212             return toMessage();
213         }
214  	
215  		public String toHtmlString() {
216 			return super.toString() + "[<br/>" +
217             	
218             	"<b>DoubleJump</b> = " +
219             	String.valueOf(isDoubleJump()
220  	) +
221             	" <br/> " +
222             	
223             	"<b>Delay</b> = " +
224             	String.valueOf(getDelay()
225  	) +
226             	" <br/> " +
227             	
228             	"<b>Force</b> = " +
229             	String.valueOf(getForce()
230  	) +
231             	" <br/> " +
232             	 
233             	"<br/>]"
234             ;
235 		}
236  	
237 		public String toMessage() {
238      		StringBuffer buf = new StringBuffer();
239      		buf.append("JUMP");
240      		
241 						if (DoubleJump != null) {
242 							buf.append(" {DoubleJump " + DoubleJump + "}");
243 						}
244 					
245 						if (Delay != null) {
246 							buf.append(" {Delay " + Delay + "}");
247 						}
248 					
249 						if (Force != null) {
250 							buf.append(" {Force " + Force + "}");
251 						}
252 					
253    			return buf.toString();
254    		}
255  	
256  		// --- Extra Java from XML BEGIN (extra/code/java)
257         	
258 		// --- Extra Java from XML END (extra/code/java)
259  	
260 	        }
261