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  		Use this to kill bot and force him to respawn, you can specify
35  		start location and rotation. Work also for human players and
36  		spectators in the game. This command can be issued also by bot
37  		on the bot itself (in this case Id attribute is not parsed).
38  	
39                            Corresponding GameBots command is
40                            RESPAWN.
41                        
42               */
43              
44              public class
45              Respawn extends
46          CommandMessage
47  
48              {
49              
50              /**
51                Creates new instance of command Respawn.
52                
53  		Use this to kill bot and force him to respawn, you can specify
54  		start location and rotation. Work also for human players and
55  		spectators in the game. This command can be issued also by bot
56  		on the bot itself (in this case Id attribute is not parsed).
57  	Corresponding GameBots message for this command is
58                RESPAWN.
59                    @param Id 
60  			Id of the bot to be respawned (not used if command sent to
61  			bot).
62  		
63                    @param StartLocation 
64  			Where bot respawns. If you want to respawn bot at random,
65  			don't specify StartLocation.
66  		
67                    @param StartRotation Initial rotation of the bot.
68                */
69               public Respawn(
70                  UnrealId Id,  Location StartLocation,  Rotation StartRotation) {
71                      
72                      this.Id = Id;
73                  
74                      this.StartLocation = StartLocation;
75                  
76                      this.StartRotation = StartRotation;
77                  
78                  }
79  
80              
81              		/**
82  		             Creates new instance of command Respawn.
83  		             
84  		Use this to kill bot and force him to respawn, you can specify
85  		start location and rotation. Work also for human players and
86  		spectators in the game. This command can be issued also by bot
87  		on the bot itself (in this case Id attribute is not parsed).
88  	Corresponding GameBots message for this command is
89  		             RESPAWN.
90  		             <p></p>WARNING: this is empty-command constructor, you have to use setters to fill it up!
91  		             */
92              		public  Respawn() {
93              		}
94              	
95  
96              /////// Properties BEGIN
97              
98          /**
99          
100 			Id of the bot to be respawned (not used if command sent to
101 			bot).
102 		 */
103         protected
104          UnrealId Id =
105         	null;
106 
107         
108         /**
109         
110 			Id of the bot to be respawned (not used if command sent to
111 			bot).
112 		 */
113         public
114         UnrealId getId() {
115             return
116          Id;
117         }
118         
119 
120         
121             /**
122         
123 			Id of the bot to be respawned (not used if command sent to
124 			bot).
125 		 */
126         public Respawn setId(UnrealId Id) {
127             this.Id = Id;
128             return this;
129             }
130        
131         /**
132         
133 			Where bot respawns. If you want to respawn bot at random,
134 			don't specify StartLocation.
135 		 */
136         protected
137          Location StartLocation =
138         	null;
139 
140         
141         /**
142         
143 			Where bot respawns. If you want to respawn bot at random,
144 			don't specify StartLocation.
145 		 */
146         public
147         Location getStartLocation() {
148             return
149          StartLocation;
150         }
151         
152 
153         
154             /**
155         
156 			Where bot respawns. If you want to respawn bot at random,
157 			don't specify StartLocation.
158 		 */
159         public Respawn setStartLocation(Location StartLocation) {
160             this.StartLocation = StartLocation;
161             return this;
162             }
163        
164         /**
165         Initial rotation of the bot. */
166         protected
167          Rotation StartRotation =
168         	null;
169 
170         
171         /**
172         Initial rotation of the bot. */
173         public
174         Rotation getStartRotation() {
175             return
176          StartRotation;
177         }
178         
179 
180         
181             /**
182         Initial rotation of the bot. */
183         public Respawn setStartRotation(Rotation StartRotation) {
184             this.StartRotation = StartRotation;
185             return this;
186             }
187        
188             /////// Properties END
189 
190             /////// Extra Java code BEGIN
191 
192             	/////// Additional code from xslt BEGIN
193             		
194 
195 
196             	/////// Additional code from xslt END
197 
198 	            /////// Extra Java from XML BEGIN
199             		
200             	/////// Extra Java from XML END
201 
202             /////// Extra Java code END
203 
204             
205 
206             /**
207               * Cloning constructor.
208               */
209              public Respawn(Respawn original) {
210                 
211                      this.Id=original.Id;
212                 
213                      this.StartLocation=original.StartLocation;
214                 
215                      this.StartRotation=original.StartRotation;
216                 
217              }
218 
219              
220 
221                  
222             public String toString() {
223                 return
224                 
225                     	toMessage();
226                     
227              }
228 
229              public String toHtmlString() {
230                 return super.toString() +
231             
232             "<b>Id</b> : " +
233             String.valueOf(Id) +
234             " <br/> " +
235             
236             "<b>StartLocation</b> : " +
237             String.valueOf(StartLocation) +
238             " <br/> " +
239             
240             "<b>StartRotation</b> : " +
241             String.valueOf(StartRotation) +
242             " <br/> " +
243              "";
244              }
245 
246              
247              
248              	 public String toMessage() {
249               		StringBuffer buf = new StringBuffer();
250               		buf.append("RESPAWN");
251               		
252 		    					if (Id != null) {
253 		    						buf.append(" {Id " + Id.getStringId() + "}");
254 		    					}
255 		    				
256                                 if (StartLocation != null) {
257                                     buf.append(" {StartLocation " +
258                                         StartLocation.getX() + "," +
259                                         StartLocation.getY() + "," +
260                                         StartLocation.getZ() + "}");
261                                 }
262                             
263                                 if (StartRotation != null) {
264                                     buf.append(" {StartRotation " +
265                                         StartRotation.getPitch() + "," +
266                                         StartRotation.getYaw() + "," +
267                                         StartRotation.getRoll() + "}");
268                                 }
269                             
270             		return buf.toString();
271             }
272              
273              }
274 
275