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 send a ray from specified location to specified
35  		destination, responds with FTR message. FTRACE uses FastTrace
36  		function, which is faster then Trace function, but still rather
37  		slow.
38  	
39                            Corresponding GameBots command is
40                            FTRACE.
41                        
42               */
43              
44              public class
45              FastTrace extends
46          CommandMessage
47  
48              {
49              
50              /**
51                Creates new instance of command FastTrace.
52                
53  		Will send a ray from specified location to specified
54  		destination, responds with FTR message. FTRACE uses FastTrace
55  		function, which is faster then Trace function, but still rather
56  		slow.
57  	Corresponding GameBots message for this command is
58                FTRACE.
59                    @param Id 
60  			Message Id made up by you and echoed in response so you can
61  			match up response with query.
62  		
63                    @param From 
64  			Origin point of the ray. If you won't support From
65  			attribute, current bot location will be taken as From.
66  		
67                    @param To Target point of the ray.
68                */
69               public FastTrace(
70                  String Id,  Location From,  Location To) {
71                      
72                      this.Id = Id;
73                  
74                      this.From = From;
75                  
76                      this.To = To;
77                  
78                  }
79  
80              
81              		/**
82  		             Creates new instance of command FastTrace.
83  		             
84  		Will send a ray from specified location to specified
85  		destination, responds with FTR message. FTRACE uses FastTrace
86  		function, which is faster then Trace function, but still rather
87  		slow.
88  	Corresponding GameBots message for this command is
89  		             FTRACE.
90  		             <p></p>WARNING: this is empty-command constructor, you have to use setters to fill it up!
91  		             */
92              		public  FastTrace() {
93              		}
94              	
95  
96              /////// Properties BEGIN
97              
98          /**
99          
100 			Message Id made up by you and echoed in response so you can
101 			match up response with query.
102 		 */
103         protected
104          String Id =
105         	null;
106 
107         
108         /**
109         
110 			Message Id made up by you and echoed in response so you can
111 			match up response with query.
112 		 */
113         public
114         String getId() {
115             return
116          Id;
117         }
118         
119 
120         
121             /**
122         
123 			Message Id made up by you and echoed in response so you can
124 			match up response with query.
125 		 */
126         public FastTrace setId(String Id) {
127             this.Id = Id;
128             return this;
129             }
130        
131         /**
132         
133 			Origin point of the ray. If you won't support From
134 			attribute, current bot location will be taken as From.
135 		 */
136         protected
137          Location From =
138         	null;
139 
140         
141         /**
142         
143 			Origin point of the ray. If you won't support From
144 			attribute, current bot location will be taken as From.
145 		 */
146         public
147         Location getFrom() {
148             return
149          From;
150         }
151         
152 
153         
154             /**
155         
156 			Origin point of the ray. If you won't support From
157 			attribute, current bot location will be taken as From.
158 		 */
159         public FastTrace setFrom(Location From) {
160             this.From = From;
161             return this;
162             }
163        
164         /**
165         Target point of the ray. */
166         protected
167          Location To =
168         	null;
169 
170         
171         /**
172         Target point of the ray. */
173         public
174         Location getTo() {
175             return
176          To;
177         }
178         
179 
180         
181             /**
182         Target point of the ray. */
183         public FastTrace setTo(Location To) {
184             this.To = To;
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 FastTrace(FastTrace original) {
210                 
211                      this.Id=original.Id;
212                 
213                      this.From=original.From;
214                 
215                      this.To=original.To;
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>From</b> : " +
237             String.valueOf(From) +
238             " <br/> " +
239             
240             "<b>To</b> : " +
241             String.valueOf(To) +
242             " <br/> " +
243              "";
244              }
245 
246              
247              
248              	 public String toMessage() {
249               		StringBuffer buf = new StringBuffer();
250               		buf.append("FTRACE");
251               		
252 		    					if (Id != null) {
253 		    						buf.append(" {Id " + Id + "}");
254 		    					}
255 		    				
256                                 if (From != null) {
257                                     buf.append(" {From " +
258                                         From.getX() + "," +
259                                         From.getY() + "," +
260                                         From.getZ() + "}");
261                                 }
262                             
263                                 if (To != null) {
264                                     buf.append(" {To " +
265                                         To.getX() + "," +
266                                         To.getY() + "," +
267                                         To.getZ() + "}");
268                                 }
269                             
270             		return buf.toString();
271             }
272              
273              }
274 
275