View Javadoc

1   
2               /**
3               IMPORTANT !!!
4   
5               DO NOT EDIT THIS FILE. IT IS GENERATED FROM approriate xml file in xmlresources/gbinfomessages 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.gbinfomessages;
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  		Asynchronous message. Response of the FASTTRACE command. Note
35  		that trace commands are computationally expensive.
36  	
37                            Corresponding GameBots message is
38                            FTR.
39                        
40               */
41              
42              public class
43              FastTraceResponse
44                      extends GBEvent
45                  
46  	            	implements IWorldEvent, IWorldChangeEvent
47  
48              {
49              
50              /**
51                Creates new instance of command FastTraceResponse.
52                
53  		Asynchronous message. Response of the FASTTRACE command. Note
54  		that trace commands are computationally expensive.
55  	Corresponding GameBots message for this command is
56                .
57                    @param Id 
58  			An Id matching the one sent by client. Allows bot to match
59  			answer with right query.
60  		
61                    @param From 
62  			Location from which the ray is emitted.
63  		
64                    @param To 
65  			Location to which the ray is sent.
66  		
67                    @param Result 
68  			True if it hit something, false if not.
69  		
70                */
71               public FastTraceResponse(
72                  String Id,  Location From,  Location To,  boolean Result) {
73                      
74                      this.Id = Id;
75                  
76                      this.From = From;
77                  
78                      this.To = To;
79                  
80                      this.Result = Result;
81                  
82                  }
83  
84              
85      	/** Example how the message looks like - used during parser tests. */
86      	public static final String PROTOTYPE =
87      		"FTR {Id text} {From 0,0,0} {To 0,0,0} {Result False}";
88      
89  
90              /////// Properties BEGIN
91              
92          /**
93          
94  			An Id matching the one sent by client. Allows bot to match
95  			answer with right query.
96  		 */
97          protected
98           String Id =
99          	null;
100 
101         
102         /**
103         
104 			An Id matching the one sent by client. Allows bot to match
105 			answer with right query.
106 		 */
107         public
108         String getId() {
109             return
110          Id;
111         }
112         
113 
114         
115         /**
116         
117 			Location from which the ray is emitted.
118 		 */
119         protected
120          Location From =
121         	null;
122 
123         
124         /**
125         
126 			Location from which the ray is emitted.
127 		 */
128         public
129         Location getFrom() {
130             return
131          From;
132         }
133         
134 
135         
136         /**
137         
138 			Location to which the ray is sent.
139 		 */
140         protected
141          Location To =
142         	null;
143 
144         
145         /**
146         
147 			Location to which the ray is sent.
148 		 */
149         public
150         Location getTo() {
151             return
152          To;
153         }
154         
155 
156         
157         /**
158         
159 			True if it hit something, false if not.
160 		 */
161         protected
162          boolean Result =
163         	false;
164 
165         
166         /**
167         
168 			True if it hit something, false if not.
169 		 */
170         public
171         boolean isResult() {
172             return
173          Result;
174         }
175         
176 
177         
178             /////// Properties END
179 
180             /////// Extra Java code BEGIN
181 
182             	/////// Additional code from xslt BEGIN
183             		
184        					public long getSimTime() {
185        						// NOT IMPLEMENTED FOR UDK
186        						return 0;
187        					}
188             		
189 
190 
191             	/////// Additional code from xslt END
192 
193 	            /////// Extra Java from XML BEGIN
194             		
195             	/////// Extra Java from XML END
196 
197             /////// Extra Java code END
198 
199             
200 
201             /**
202               * Cloning constructor.
203               */
204              public FastTraceResponse(FastTraceResponse original) {
205                 
206                      this.Id=original.Id;
207                 
208                      this.From=original.From;
209                 
210                      this.To=original.To;
211                 
212                      this.Result=original.Result;
213                 
214              }
215 
216              
217                  /**
218                   * Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
219                   */
220 	             public FastTraceResponse() {
221 	             }
222              
223 
224                  
225             public String toString() {
226                 return
227                 
228                 		super.toString() + " | " +
229                 		
230 				               "Id = " +
231 				               String.valueOf(Id) + " | " +
232 				            
233 				               "From = " +
234 				               String.valueOf(From) + " | " +
235 				            
236 				               "To = " +
237 				               String.valueOf(To) + " | " +
238 				            
239 				               "Result = " +
240 				               String.valueOf(Result) + " | " +
241 				             "";
242                 	
243              }
244 
245              public String toHtmlString() {
246                 return super.toString() +
247             
248             "<b>Id</b> : " +
249             String.valueOf(Id) +
250             " <br/> " +
251             
252             "<b>From</b> : " +
253             String.valueOf(From) +
254             " <br/> " +
255             
256             "<b>To</b> : " +
257             String.valueOf(To) +
258             " <br/> " +
259             
260             "<b>Result</b> : " +
261             String.valueOf(Result) +
262             " <br/> " +
263              "";
264              }
265 
266              
267              
268              }
269 
270