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                
34  		Specify a point, rotation value or object to turn towards.
35  	
36                            Corresponding GameBots command is
37                            TURNTO.
38                        
39               */
40              
41              public class
42              TurnTo extends
43          CommandMessage
44  
45              {
46              
47              /**
48                Creates new instance of command TurnTo.
49                
50  		Specify a point, rotation value or object to turn towards.
51  	Corresponding GameBots message for this command is
52                TURNTO.
53                    @param Target 
54  			The unique id of a player/object/nav point/whatever that you
55  			want to face. Must be visible.
56  		
57                    @param Rotation 
58  			Absolute rotation you want to spin to. Must be provided as comma
59  			delimited ("0,50000,0") and should be in absolute terms and
60  			in UT units (2pi = 65535 units). Used only if no target
61  			provided. Rotation is parsed: First pitch (up, down), then yaw (left, right), the roll (no effect here, however it is an equivalent of doing a cartwheel).
62  		
63                    @param Location 
64  			Location you want to face. Normal rules for location. Only
65  			used if no Target or Rotation.
66  		
67                */
68               public TurnTo(
69                  UnrealId Target,  Rotation Rotation,  Location Location) {
70                      
71                      this.Target = Target;
72                  
73                      this.Rotation = Rotation;
74                  
75                      this.Location = Location;
76                  
77                  }
78  
79              
80              		/**
81  		             Creates new instance of command TurnTo.
82  		             
83  		Specify a point, rotation value or object to turn towards.
84  	Corresponding GameBots message for this command is
85  		             TURNTO.
86  		             <p></p>WARNING: this is empty-command constructor, you have to use setters to fill it up!
87  		             */
88              		public  TurnTo() {
89              		}
90              	
91  
92              /////// Properties BEGIN
93              
94          /**
95          
96  			The unique id of a player/object/nav point/whatever that you
97  			want to face. Must be visible.
98  		 */
99          protected
100          UnrealId Target =
101         	null;
102 
103         
104         /**
105         
106 			The unique id of a player/object/nav point/whatever that you
107 			want to face. Must be visible.
108 		 */
109         public
110         UnrealId getTarget() {
111             return
112          Target;
113         }
114         
115 
116         
117             /**
118         
119 			The unique id of a player/object/nav point/whatever that you
120 			want to face. Must be visible.
121 		 */
122         public TurnTo setTarget(UnrealId Target) {
123             this.Target = Target;
124             return this;
125             }
126        
127         /**
128         
129 			Absolute rotation you want to spin to. Must be provided as comma
130 			delimited ("0,50000,0") and should be in absolute terms and
131 			in UT units (2pi = 65535 units). Used only if no target
132 			provided. Rotation is parsed: First pitch (up, down), then yaw (left, right), the roll (no effect here, however it is an equivalent of doing a cartwheel).
133 		 */
134         protected
135          Rotation Rotation =
136         	null;
137 
138         
139         /**
140         
141 			Absolute rotation you want to spin to. Must be provided as comma
142 			delimited ("0,50000,0") and should be in absolute terms and
143 			in UT units (2pi = 65535 units). Used only if no target
144 			provided. Rotation is parsed: First pitch (up, down), then yaw (left, right), the roll (no effect here, however it is an equivalent of doing a cartwheel).
145 		 */
146         public
147         Rotation getRotation() {
148             return
149          Rotation;
150         }
151         
152 
153         
154             /**
155         
156 			Absolute rotation you want to spin to. Must be provided as comma
157 			delimited ("0,50000,0") and should be in absolute terms and
158 			in UT units (2pi = 65535 units). Used only if no target
159 			provided. Rotation is parsed: First pitch (up, down), then yaw (left, right), the roll (no effect here, however it is an equivalent of doing a cartwheel).
160 		 */
161         public TurnTo setRotation(Rotation Rotation) {
162             this.Rotation = Rotation;
163             return this;
164             }
165        
166         /**
167         
168 			Location you want to face. Normal rules for location. Only
169 			used if no Target or Rotation.
170 		 */
171         protected
172          Location Location =
173         	null;
174 
175         
176         /**
177         
178 			Location you want to face. Normal rules for location. Only
179 			used if no Target or Rotation.
180 		 */
181         public
182         Location getLocation() {
183             return
184          Location;
185         }
186         
187 
188         
189             /**
190         
191 			Location you want to face. Normal rules for location. Only
192 			used if no Target or Rotation.
193 		 */
194         public TurnTo setLocation(Location Location) {
195             this.Location = Location;
196             return this;
197             }
198        
199             /////// Properties END
200 
201             /////// Extra Java code BEGIN
202 
203             	/////// Additional code from xslt BEGIN
204             		
205 
206 
207             	/////// Additional code from xslt END
208 
209 	            /////// Extra Java from XML BEGIN
210             		
211             	/////// Extra Java from XML END
212 
213             /////// Extra Java code END
214 
215             
216 
217             /**
218               * Cloning constructor.
219               */
220              public TurnTo(TurnTo original) {
221                 
222                      this.Target=original.Target;
223                 
224                      this.Rotation=original.Rotation;
225                 
226                      this.Location=original.Location;
227                 
228              }
229 
230              
231 
232                  
233             public String toString() {
234                 return
235                 
236                     	toMessage();
237                     
238              }
239 
240              public String toHtmlString() {
241                 return super.toString() +
242             
243             "<b>Target</b> : " +
244             String.valueOf(Target) +
245             " <br/> " +
246             
247             "<b>Rotation</b> : " +
248             String.valueOf(Rotation) +
249             " <br/> " +
250             
251             "<b>Location</b> : " +
252             String.valueOf(Location) +
253             " <br/> " +
254              "";
255              }
256 
257              
258              
259              	 public String toMessage() {
260               		StringBuffer buf = new StringBuffer();
261               		buf.append("TURNTO");
262               		
263 		    					if (Target != null) {
264 		    						buf.append(" {Target " + Target.getStringId() + "}");
265 		    					}
266 		    				
267                                 if (Rotation != null) {
268                                     buf.append(" {Rotation " +
269                                         Rotation.getPitch() + "," +
270                                         Rotation.getYaw() + "," +
271                                         Rotation.getRoll() + "}");
272                                 }
273                             
274                                 if (Location != null) {
275                                     buf.append(" {Location " +
276                                         Location.getX() + "," +
277                                         Location.getY() + "," +
278                                         Location.getZ() + "}");
279                                 }
280                             
281             		return buf.toString();
282             }
283              
284              }
285 
286