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 add original epic bot to a game. May have issues with team.
35  		balancing.
36  	
37                            Corresponding GameBots command is
38                            ADDBOT.
39                        
40               */
41              
42              public class
43              AddBot extends
44          CommandMessage
45  
46              {
47              
48              /**
49                Creates new instance of command AddBot.
50                
51  		Will add original epic bot to a game. May have issues with team.
52  		balancing.
53  	Corresponding GameBots message for this command is
54                ADDBOT.
55                    @param Name Optional name of the bot.
56                    @param StartLocation 
57  			Optional start location of the bot.
58  		
59                    @param StartRotation 
60  			Optional start rotation of the bot.
61  		
62                    @param Skill 
63  			Skill of the bot - from 1 to 7 (best).
64  		
65                    @param Type 
66  			The class of the added bot - optional.
67  		
68                */
69               public AddBot(
70                  String Name,  Location StartLocation,  Rotation StartRotation,  int Skill,  String Type) {
71                      
72                      this.Name = Name;
73                  
74                      this.StartLocation = StartLocation;
75                  
76                      this.StartRotation = StartRotation;
77                  
78                      this.Skill = Skill;
79                  
80                      this.Type = Type;
81                  
82                  }
83  
84              
85              		/**
86  		             Creates new instance of command AddBot.
87  		             
88  		Will add original epic bot to a game. May have issues with team.
89  		balancing.
90  	Corresponding GameBots message for this command is
91  		             ADDBOT.
92  		             <p></p>WARNING: this is empty-command constructor, you have to use setters to fill it up!
93  		             */
94              		public  AddBot() {
95              		}
96              	
97  
98              /////// Properties BEGIN
99              
100         /**
101         Optional name of the bot. */
102         protected
103          String Name =
104         	null;
105 
106         
107         /**
108         Optional name of the bot. */
109         public
110         String getName() {
111             return
112          Name;
113         }
114         
115 
116         
117             /**
118         Optional name of the bot. */
119         public AddBot setName(String Name) {
120             this.Name = Name;
121             return this;
122             }
123        
124         /**
125         
126 			Optional start location of the bot.
127 		 */
128         protected
129          Location StartLocation =
130         	null;
131 
132         
133         /**
134         
135 			Optional start location of the bot.
136 		 */
137         public
138         Location getStartLocation() {
139             return
140          StartLocation;
141         }
142         
143 
144         
145             /**
146         
147 			Optional start location of the bot.
148 		 */
149         public AddBot setStartLocation(Location StartLocation) {
150             this.StartLocation = StartLocation;
151             return this;
152             }
153        
154         /**
155         
156 			Optional start rotation of the bot.
157 		 */
158         protected
159          Rotation StartRotation =
160         	null;
161 
162         
163         /**
164         
165 			Optional start rotation of the bot.
166 		 */
167         public
168         Rotation getStartRotation() {
169             return
170          StartRotation;
171         }
172         
173 
174         
175             /**
176         
177 			Optional start rotation of the bot.
178 		 */
179         public AddBot setStartRotation(Rotation StartRotation) {
180             this.StartRotation = StartRotation;
181             return this;
182             }
183        
184         /**
185         
186 			Skill of the bot - from 1 to 7 (best).
187 		 */
188         protected
189          int Skill =
190         	3;
191 
192         
193         /**
194         
195 			Skill of the bot - from 1 to 7 (best).
196 		 */
197         public
198         int getSkill() {
199             return
200          Skill;
201         }
202         
203 
204         
205             /**
206         
207 			Skill of the bot - from 1 to 7 (best).
208 		 */
209         public AddBot setSkill(int Skill) {
210             this.Skill = Skill;
211             return this;
212             }
213        
214         /**
215         
216 			The class of the added bot - optional.
217 		 */
218         protected
219          String Type =
220         	null;
221 
222         
223         /**
224         
225 			The class of the added bot - optional.
226 		 */
227         public
228         String getType() {
229             return
230          Type;
231         }
232         
233 
234         
235             /**
236         
237 			The class of the added bot - optional.
238 		 */
239         public AddBot setType(String Type) {
240             this.Type = Type;
241             return this;
242             }
243        
244             /////// Properties END
245 
246             /////// Extra Java code BEGIN
247 
248             	/////// Additional code from xslt BEGIN
249             		
250 
251 
252             	/////// Additional code from xslt END
253 
254 	            /////// Extra Java from XML BEGIN
255             		
256             	/////// Extra Java from XML END
257 
258             /////// Extra Java code END
259 
260             
261 
262             /**
263               * Cloning constructor.
264               */
265              public AddBot(AddBot original) {
266                 
267                      this.Name=original.Name;
268                 
269                      this.StartLocation=original.StartLocation;
270                 
271                      this.StartRotation=original.StartRotation;
272                 
273                      this.Skill=original.Skill;
274                 
275                      this.Type=original.Type;
276                 
277              }
278 
279              
280 
281                  
282             public String toString() {
283                 return
284                 
285                     	toMessage();
286                     
287              }
288 
289              public String toHtmlString() {
290                 return super.toString() +
291             
292             "<b>Name</b> : " +
293             String.valueOf(Name) +
294             " <br/> " +
295             
296             "<b>StartLocation</b> : " +
297             String.valueOf(StartLocation) +
298             " <br/> " +
299             
300             "<b>StartRotation</b> : " +
301             String.valueOf(StartRotation) +
302             " <br/> " +
303             
304             "<b>Skill</b> : " +
305             String.valueOf(Skill) +
306             " <br/> " +
307             
308             "<b>Type</b> : " +
309             String.valueOf(Type) +
310             " <br/> " +
311              "";
312              }
313 
314              
315              
316              	 public String toMessage() {
317               		StringBuffer buf = new StringBuffer();
318               		buf.append("ADDBOT");
319               		
320 		    					if (Name != null) {
321 		    						buf.append(" {Name " + Name + "}");
322 		    					}
323 		    				
324                                 if (StartLocation != null) {
325                                     buf.append(" {StartLocation " +
326                                         StartLocation.getX() + "," +
327                                         StartLocation.getY() + "," +
328                                         StartLocation.getZ() + "}");
329                                 }
330                             
331                                 if (StartRotation != null) {
332                                     buf.append(" {StartRotation " +
333                                         StartRotation.getPitch() + "," +
334                                         StartRotation.getYaw() + "," +
335                                         StartRotation.getRoll() + "}");
336                                 }
337                             
338 		    					buf.append(" {Skill " + Skill + "}");
339 		    				
340 		    					if (Type != null) {
341 		    						buf.append(" {Type " + Type + "}");
342 		    					}
343 		    				
344             		return buf.toString();
345             }
346              
347              }
348 
349