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 THESE FILES INSTEAD OF THIS ONE.
7   
8               IMPORTANT END !!!
9               */
10              package
11              cz.cuni.amis.pogamut.udk.communication.messages.gbcommands;
12  	    		import java.util.*;
13      import javax.vecmath.*;
14      import cz.cuni.amis.pogamut.base.communication.messages.*;
15      import cz.cuni.amis.pogamut.base.communication.worldview.*;
16      import cz.cuni.amis.pogamut.base.communication.worldview.event.*;
17      import cz.cuni.amis.pogamut.base.communication.worldview.object.*;
18      import cz.cuni.amis.pogamut.base.communication.translator.event.*;
19      import cz.cuni.amis.pogamut.base3d.worldview.object.*;
20      import cz.cuni.amis.pogamut.base3d.worldview.object.event.*;
21      import cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId;
22      import cz.cuni.amis.pogamut.udk.communication.messages.*;
23      import cz.cuni.amis.pogamut.udk.communication.worldview.objects.*;
24      import cz.cuni.amis.pogamut.udk.communication.translator.itemdescriptor.*;
25      import cz.cuni.amis.pogamut.udk.communication.messages.ItemType.Category;
26      import cz.cuni.amis.utils.exception.*;
27      import cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result;
28      import cz.cuni.amis.utils.SafeEquals;
29      import cz.cuni.amis.pogamut.multi.communication.worldview.object.*;
30      
31              
32              /**
33                Turns the bot by a specified amount.
34                            Corresponding GameBots command is
35                            ROTATE.
36                        
37               */
38              
39              public class
40              Rotate extends
41          CommandMessage
42  
43              {
44              
45              /**
46                Creates new instance of command Rotate.
47                Turns the bot by a specified amount.Corresponding GameBots message for this command is
48                ROTATE.
49                    @param Amount 
50  			Amount in UT units to rotate. May be negative to rotate
51  			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).
52  		
53                    @param Axis 
54  			If provided as "Vertical", rotation will be done to Pitch
55  			(up/down). Any other value, or not provided, and rotation
56  			will be to Yaw (left/right).
57  		
58                */
59               public Rotate(
60                  int Amount,  String Axis) {
61                      
62                      this.Amount = Amount;
63                  
64                      this.Axis = Axis;
65                  
66                  }
67  
68              
69              		/**
70  		             Creates new instance of command Rotate.
71  		             Turns the bot by a specified amount.Corresponding GameBots message for this command is
72  		             ROTATE.
73  		             <p></p>WARNING: this is empty-command constructor, you have to use setters to fill it up!
74  		             */
75              		public  Rotate() {
76              		}
77              	
78  
79              /////// Properties BEGIN
80              
81          /**
82          
83  			Amount in UT units to rotate. May be negative to rotate
84  			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).
85  		 */
86          protected
87           int Amount =
88          	0;
89  
90          
91          /**
92          
93  			Amount in UT units to rotate. May be negative to rotate
94  			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).
95  		 */
96          public
97          int getAmount() {
98              return
99           Amount;
100         }
101         
102 
103         
104             /**
105         
106 			Amount in UT units to rotate. May be negative to rotate
107 			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).
108 		 */
109         public Rotate setAmount(int Amount) {
110             this.Amount = Amount;
111             return this;
112             }
113        
114         /**
115         
116 			If provided as "Vertical", rotation will be done to Pitch
117 			(up/down). Any other value, or not provided, and rotation
118 			will be to Yaw (left/right).
119 		 */
120         protected
121          String Axis =
122         	null;
123 
124         
125         /**
126         
127 			If provided as "Vertical", rotation will be done to Pitch
128 			(up/down). Any other value, or not provided, and rotation
129 			will be to Yaw (left/right).
130 		 */
131         public
132         String getAxis() {
133             return
134          Axis;
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         public Rotate setAxis(String Axis) {
146             this.Axis = Axis;
147             return this;
148             }
149        
150             /////// Properties END
151 
152             /////// Extra Java code BEGIN
153 
154             	/////// Additional code from xslt BEGIN
155             		
156 
157 
158             	/////// Additional code from xslt END
159 
160 	            /////// Extra Java from XML BEGIN
161             		
162             	/////// Extra Java from XML END
163 
164             /////// Extra Java code END
165 
166             
167 
168             /**
169               * Cloning constructor.
170               */
171              public Rotate(Rotate original) {
172                 
173                      this.Amount=original.Amount;
174                 
175                      this.Axis=original.Axis;
176                 
177              }
178 
179              
180 
181                  
182             public String toString() {
183                 return
184                 
185                     	toMessage();
186                     
187              }
188 
189              public String toHtmlString() {
190                 return super.toString() +
191             
192             "<b>Amount</b> : " +
193             String.valueOf(Amount) +
194             " <br/> " +
195             
196             "<b>Axis</b> : " +
197             String.valueOf(Axis) +
198             " <br/> " +
199              "";
200              }
201 
202              
203              
204              	 public String toMessage() {
205               		StringBuffer buf = new StringBuffer();
206               		buf.append("ROTATE");
207               		
208 		    					buf.append(" {Amount " + Amount + "}");
209 		    				
210 		    					if (Axis != null) {
211 		    						buf.append(" {Axis " + Axis + "}");
212 		    					}
213 		    				
214             		return buf.toString();
215             }
216              
217              }
218 
219