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. A boolean result of a checkreach call.
35  	
36                            Corresponding GameBots message is
37                            RCH.
38                        
39               */
40              
41              public class
42              Reachable
43                      extends GBEvent
44                  
45  	            	implements IWorldEvent, IWorldChangeEvent
46  
47              {
48              
49              /**
50                Creates new instance of command Reachable.
51                
52  		Asynchronous message. A boolean result of a checkreach call.
53  	Corresponding GameBots message for this command is
54                .
55                    @param Id 
56  			An Id matching the one sent by client. Allows bot to match
57  			answer with right querry.
58  		
59                    @param Reachable 
60  			True if the bot can run here directly, false otherwise.
61  		
62                    @param From 
63  			Exact location of bot at time of check.
64  		
65                */
66               public Reachable(
67                  String Id,  boolean Reachable,  Location From) {
68                      
69                      this.Id = Id;
70                  
71                      this.Reachable = Reachable;
72                  
73                      this.From = From;
74                  
75                  }
76  
77              
78      	/** Example how the message looks like - used during parser tests. */
79      	public static final String PROTOTYPE =
80      		"RCH {Id text} {Reachable False} {From 0,0,0}";
81      
82  
83              /////// Properties BEGIN
84              
85          /**
86          
87  			An Id matching the one sent by client. Allows bot to match
88  			answer with right querry.
89  		 */
90          protected
91           String Id =
92          	null;
93  
94          
95          /**
96          
97  			An Id matching the one sent by client. Allows bot to match
98  			answer with right querry.
99  		 */
100         public
101         String getId() {
102             return
103          Id;
104         }
105         
106 
107         
108         /**
109         
110 			True if the bot can run here directly, false otherwise.
111 		 */
112         protected
113          boolean Reachable =
114         	false;
115 
116         
117         /**
118         
119 			True if the bot can run here directly, false otherwise.
120 		 */
121         public
122         boolean isReachable() {
123             return
124          Reachable;
125         }
126         
127 
128         
129         /**
130         
131 			Exact location of bot at time of check.
132 		 */
133         protected
134          Location From =
135         	null;
136 
137         
138         /**
139         
140 			Exact location of bot at time of check.
141 		 */
142         public
143         Location getFrom() {
144             return
145          From;
146         }
147         
148 
149         
150             /////// Properties END
151 
152             /////// Extra Java code BEGIN
153 
154             	/////// Additional code from xslt BEGIN
155             		
156        					public long getSimTime() {
157        						// NOT IMPLEMENTED FOR UDK
158        						return 0;
159        					}
160             		
161 
162 
163             	/////// Additional code from xslt END
164 
165 	            /////// Extra Java from XML BEGIN
166             		
167             	/////// Extra Java from XML END
168 
169             /////// Extra Java code END
170 
171             
172 
173             /**
174               * Cloning constructor.
175               */
176              public Reachable(Reachable original) {
177                 
178                      this.Id=original.Id;
179                 
180                      this.Reachable=original.Reachable;
181                 
182                      this.From=original.From;
183                 
184              }
185 
186              
187                  /**
188                   * Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
189                   */
190 	             public Reachable() {
191 	             }
192              
193 
194                  
195             public String toString() {
196                 return
197                 
198                 		super.toString() + " | " +
199                 		
200 				               "Id = " +
201 				               String.valueOf(Id) + " | " +
202 				            
203 				               "Reachable = " +
204 				               String.valueOf(Reachable) + " | " +
205 				            
206 				               "From = " +
207 				               String.valueOf(From) + " | " +
208 				             "";
209                 	
210              }
211 
212              public String toHtmlString() {
213                 return super.toString() +
214             
215             "<b>Id</b> : " +
216             String.valueOf(Id) +
217             " <br/> " +
218             
219             "<b>Reachable</b> : " +
220             String.valueOf(Reachable) +
221             " <br/> " +
222             
223             "<b>From</b> : " +
224             String.valueOf(From) +
225             " <br/> " +
226              "";
227              }
228 
229              
230              
231              }
232 
233