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  		Will spawn an actor in the game specified by Type (holds the
35  		class of the actor). Be carefull with what you spawn and where
36  		you spawn it. Possible use - for some additional inventory
37  		spawns.
38  	
39                            Corresponding GameBots command is
40                            SPAWNACTOR.
41                        
42               */
43              
44              public class
45              SpawnActor extends
46          CommandMessage
47  
48              {
49              
50              /**
51                Creates new instance of command SpawnActor.
52                
53  		Will spawn an actor in the game specified by Type (holds the
54  		class of the actor). Be carefull with what you spawn and where
55  		you spawn it. Possible use - for some additional inventory
56  		spawns.
57  	Corresponding GameBots message for this command is
58                SPAWNACTOR.
59                    @param Location 
60  			Location where the actor will be spawned.
61  		
62                    @param Rotation Initial rotation of the actor.
63                    @param Type 
64  			Holds the desired actor class (e.g.
65  			LinkGun.WeaponPickup).
66  		
67                */
68               public SpawnActor(
69                  Location Location,  Rotation Rotation,  String Type) {
70                      
71                      this.Location = Location;
72                  
73                      this.Rotation = Rotation;
74                  
75                      this.Type = Type;
76                  
77                  }
78  
79              
80              		/**
81  		             Creates new instance of command SpawnActor.
82  		             
83  		Will spawn an actor in the game specified by Type (holds the
84  		class of the actor). Be carefull with what you spawn and where
85  		you spawn it. Possible use - for some additional inventory
86  		spawns.
87  	Corresponding GameBots message for this command is
88  		             SPAWNACTOR.
89  		             <p></p>WARNING: this is empty-command constructor, you have to use setters to fill it up!
90  		             */
91              		public  SpawnActor() {
92              		}
93              	
94  
95              /////// Properties BEGIN
96              
97          /**
98          
99  			Location where the actor will be spawned.
100 		 */
101         protected
102          Location Location =
103         	null;
104 
105         
106         /**
107         
108 			Location where the actor will be spawned.
109 		 */
110         public
111         Location getLocation() {
112             return
113          Location;
114         }
115         
116 
117         
118             /**
119         
120 			Location where the actor will be spawned.
121 		 */
122         public SpawnActor setLocation(Location Location) {
123             this.Location = Location;
124             return this;
125             }
126        
127         /**
128         Initial rotation of the actor. */
129         protected
130          Rotation Rotation =
131         	null;
132 
133         
134         /**
135         Initial rotation of the actor. */
136         public
137         Rotation getRotation() {
138             return
139          Rotation;
140         }
141         
142 
143         
144             /**
145         Initial rotation of the actor. */
146         public SpawnActor setRotation(Rotation Rotation) {
147             this.Rotation = Rotation;
148             return this;
149             }
150        
151         /**
152         
153 			Holds the desired actor class (e.g.
154 			LinkGun.WeaponPickup).
155 		 */
156         protected
157          String Type =
158         	null;
159 
160         
161         /**
162         
163 			Holds the desired actor class (e.g.
164 			LinkGun.WeaponPickup).
165 		 */
166         public
167         String getType() {
168             return
169          Type;
170         }
171         
172 
173         
174             /**
175         
176 			Holds the desired actor class (e.g.
177 			LinkGun.WeaponPickup).
178 		 */
179         public SpawnActor setType(String Type) {
180             this.Type = Type;
181             return this;
182             }
183        
184             /////// Properties END
185 
186             /////// Extra Java code BEGIN
187 
188             	/////// Additional code from xslt BEGIN
189             		
190 
191 
192             	/////// Additional code from xslt END
193 
194 	            /////// Extra Java from XML BEGIN
195             		
196             	/////// Extra Java from XML END
197 
198             /////// Extra Java code END
199 
200             
201 
202             /**
203               * Cloning constructor.
204               */
205              public SpawnActor(SpawnActor original) {
206                 
207                      this.Location=original.Location;
208                 
209                      this.Rotation=original.Rotation;
210                 
211                      this.Type=original.Type;
212                 
213              }
214 
215              
216 
217                  
218             public String toString() {
219                 return
220                 
221                     	toMessage();
222                     
223              }
224 
225              public String toHtmlString() {
226                 return super.toString() +
227             
228             "<b>Location</b> : " +
229             String.valueOf(Location) +
230             " <br/> " +
231             
232             "<b>Rotation</b> : " +
233             String.valueOf(Rotation) +
234             " <br/> " +
235             
236             "<b>Type</b> : " +
237             String.valueOf(Type) +
238             " <br/> " +
239              "";
240              }
241 
242              
243              
244              	 public String toMessage() {
245               		StringBuffer buf = new StringBuffer();
246               		buf.append("SPAWNACTOR");
247               		
248                                 if (Location != null) {
249                                     buf.append(" {Location " +
250                                         Location.getX() + "," +
251                                         Location.getY() + "," +
252                                         Location.getZ() + "}");
253                                 }
254                             
255                                 if (Rotation != null) {
256                                     buf.append(" {Rotation " +
257                                         Rotation.getPitch() + "," +
258                                         Rotation.getYaw() + "," +
259                                         Rotation.getRoll() + "}");
260                                 }
261                             
262 		    					if (Type != null) {
263 		    						buf.append(" {Type " + Type + "}");
264 		    					}
265 		    				
266             		return buf.toString();
267             }
268              
269              }
270 
271