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 ROTATE.
15   		 *
16   		 * Turns the bot by a specified amount.
17           */
18   	public class Rotate 
19  		extends CommandMessage
20  	        {
21  	        	
22  		        
23      	/** Example how the message looks like - used during parser tests. */
24      	public static final String PROTOTYPE =
25      		" {Amount 0}  {Axis text} ";
26      
27  		/**
28  		 * Creates new instance of command Rotate.
29  		 * Turns the bot by a specified amount.
30  		 * Corresponding GameBots message for this command is
31  		 * ROTATE.
32  		 *
33  		 * 
34  		 *    @param Amount 
35  			Amount in UT units to rotate. May be negative to rotate
36  			counter clockwise. This rotation is relatively added to bot current rotation, then the shortest turn to achieve this new rotation will be performed (so the maximum turn you can achive is to turn back by supporting value 32778 or -32778).
37  		
38  		 *    @param Axis 
39  			If provided as "Vertical", rotation will be done to Pitch
40  			(up/down). Any other value, or not provided, and rotation
41  			will be to Yaw (left/right).
42  		
43  		 */
44  		public Rotate(
45  			Integer Amount,  String Axis
46  		) {
47  			
48  				this.Amount = Amount;
49              
50  				this.Axis = Axis;
51              
52  		}
53  
54  		
55  			/**
56  			 * Creates new instance of command Rotate.
57  			 * Turns the bot by a specified amount.
58  			 * Corresponding GameBots message for this command is
59  			 * ROTATE.
60  			 * <p></p>
61  			 * WARNING: this is empty-command constructor, you have to use setters to fill it up with data that should be sent to GameBots2004!
62  		     */
63  		    public Rotate() {
64  		    }
65  			
66  		
67  		/**
68  		 * Cloning constructor.
69  		 *
70  		 * @param original
71  		 */
72  		public Rotate(Rotate original) {
73  		   
74  		        this.Amount = original.Amount;
75  		   
76  		        this.Axis = original.Axis;
77  		   
78  		}
79      
80  	        /**
81  	        
82  			Amount in UT units to rotate. May be negative to rotate
83  			counter clockwise. This rotation is relatively added to bot current rotation, then the shortest turn to achieve this new rotation will be performed (so the maximum turn you can achive is to turn back by supporting value 32778 or -32778).
84  		 
85  	        */
86  	        protected
87  	         Integer Amount =
88  	       	
89  	        		null
90  	        	;
91  	
92  	        
93  	        
94   		/**
95           * 
96  			Amount in UT units to rotate. May be negative to rotate
97  			counter clockwise. This rotation is relatively added to bot current rotation, then the shortest turn to achieve this new rotation will be performed (so the maximum turn you can achive is to turn back by supporting value 32778 or -32778).
98  		 
99           */
100         public Integer getAmount()
101  	
102 	        {
103 	            return
104 	        	 Amount;
105 	        }
106 	        
107 	        
108 	        
109  		
110  		/**
111          * 
112 			Amount in UT units to rotate. May be negative to rotate
113 			counter clockwise. This rotation is relatively added to bot current rotation, then the shortest turn to achieve this new rotation will be performed (so the maximum turn you can achive is to turn back by supporting value 32778 or -32778).
114 		 
115          */
116         public Rotate 
117         setAmount(Integer Amount)
118  	
119 			{
120 				this.Amount = Amount;
121 				return this;
122 			}
123 		
124 	        /**
125 	        
126 			If provided as "Vertical", rotation will be done to Pitch
127 			(up/down). Any other value, or not provided, and rotation
128 			will be to Yaw (left/right).
129 		 
130 	        */
131 	        protected
132 	         String Axis =
133 	       	
134 	        		null
135 	        	;
136 	
137 	        
138 	        
139  		/**
140          * 
141 			If provided as "Vertical", rotation will be done to Pitch
142 			(up/down). Any other value, or not provided, and rotation
143 			will be to Yaw (left/right).
144 		 
145          */
146         public String getAxis()
147  	
148 	        {
149 	            return
150 	        	 Axis;
151 	        }
152 	        
153 	        
154 	        
155  		
156  		/**
157          * 
158 			If provided as "Vertical", rotation will be done to Pitch
159 			(up/down). Any other value, or not provided, and rotation
160 			will be to Yaw (left/right).
161 		 
162          */
163         public Rotate 
164         setAxis(String Axis)
165  	
166 			{
167 				this.Axis = Axis;
168 				return this;
169 			}
170 		
171  	    public String toString() {
172             return toMessage();
173         }
174  	
175  		public String toHtmlString() {
176 			return super.toString() + "[<br/>" +
177             	
178             	"<b>Amount</b> = " +
179             	String.valueOf(getAmount()
180  	) +
181             	" <br/> " +
182             	
183             	"<b>Axis</b> = " +
184             	String.valueOf(getAxis()
185  	) +
186             	" <br/> " +
187             	 
188             	"<br/>]"
189             ;
190 		}
191  	
192 		public String toMessage() {
193      		StringBuffer buf = new StringBuffer();
194      		buf.append("ROTATE");
195      		
196 						if (Amount != null) {
197 							buf.append(" {Amount " + Amount + "}");
198 						}
199 					
200 						if (Axis != null) {
201 							buf.append(" {Axis " + Axis + "}");
202 						}
203 					
204    			return buf.toString();
205    		}
206  	
207  		// --- Extra Java from XML BEGIN (extra/code/java)
208         	
209 		// --- Extra Java from XML END (extra/code/java)
210  	
211 	        }
212