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  		Check to see if you can move directly to a destination without
35  		hitting an obstruction, falling in a pit, etc. Responding with
36  		RCH message.
37  	
38                            Corresponding GameBots command is
39                            CHECKREACH.
40                        
41               */
42              
43              public class
44              CheckReachability extends
45          CommandMessage
46  
47              {
48              
49              /**
50                Creates new instance of command CheckReachability.
51                
52  		Check to see if you can move directly to a destination without
53  		hitting an obstruction, falling in a pit, etc. Responding with
54  		RCH message.
55  	Corresponding GameBots message for this command is
56                CHECKREACH.
57                    @param Id 
58  			Message Id made up by you and echoed in response so you can
59  			match up response with query.
60  		
61                    @param Target 
62  			The unique Id of a player/object/nav point/whatever.
63  		
64                    @param Location 
65  			Location you want to go to. Normal location rules. Only used
66  			if no Target is sent.
67  		
68                */
69               public CheckReachability(
70                  String Id,  UnrealId Target,  Location Location) {
71                      
72                      this.Id = Id;
73                  
74                      this.Target = Target;
75                  
76                      this.Location = Location;
77                  
78                  }
79  
80              
81              		/**
82  		             Creates new instance of command CheckReachability.
83  		             
84  		Check to see if you can move directly to a destination without
85  		hitting an obstruction, falling in a pit, etc. Responding with
86  		RCH message.
87  	Corresponding GameBots message for this command is
88  		             CHECKREACH.
89  		             <p></p>WARNING: this is empty-command constructor, you have to use setters to fill it up!
90  		             */
91              		public  CheckReachability() {
92              		}
93              	
94  
95              /////// Properties BEGIN
96              
97          /**
98          
99  			Message Id made up by you and echoed in response so you can
100 			match up response with query.
101 		 */
102         protected
103          String Id =
104         	null;
105 
106         
107         /**
108         
109 			Message Id made up by you and echoed in response so you can
110 			match up response with query.
111 		 */
112         public
113         String getId() {
114             return
115          Id;
116         }
117         
118 
119         
120             /**
121         
122 			Message Id made up by you and echoed in response so you can
123 			match up response with query.
124 		 */
125         public CheckReachability setId(String Id) {
126             this.Id = Id;
127             return this;
128             }
129        
130         /**
131         
132 			The unique Id of a player/object/nav point/whatever.
133 		 */
134         protected
135          UnrealId Target =
136         	null;
137 
138         
139         /**
140         
141 			The unique Id of a player/object/nav point/whatever.
142 		 */
143         public
144         UnrealId getTarget() {
145             return
146          Target;
147         }
148         
149 
150         
151             /**
152         
153 			The unique Id of a player/object/nav point/whatever.
154 		 */
155         public CheckReachability setTarget(UnrealId Target) {
156             this.Target = Target;
157             return this;
158             }
159        
160         /**
161         
162 			Location you want to go to. Normal location rules. Only used
163 			if no Target is sent.
164 		 */
165         protected
166          Location Location =
167         	null;
168 
169         
170         /**
171         
172 			Location you want to go to. Normal location rules. Only used
173 			if no Target is sent.
174 		 */
175         public
176         Location getLocation() {
177             return
178          Location;
179         }
180         
181 
182         
183             /**
184         
185 			Location you want to go to. Normal location rules. Only used
186 			if no Target is sent.
187 		 */
188         public CheckReachability setLocation(Location Location) {
189             this.Location = Location;
190             return this;
191             }
192        
193             /////// Properties END
194 
195             /////// Extra Java code BEGIN
196 
197             	/////// Additional code from xslt BEGIN
198             		
199 
200 
201             	/////// Additional code from xslt END
202 
203 	            /////// Extra Java from XML BEGIN
204             		
205             	/////// Extra Java from XML END
206 
207             /////// Extra Java code END
208 
209             
210 
211             /**
212               * Cloning constructor.
213               */
214              public CheckReachability(CheckReachability original) {
215                 
216                      this.Id=original.Id;
217                 
218                      this.Target=original.Target;
219                 
220                      this.Location=original.Location;
221                 
222              }
223 
224              
225 
226                  
227             public String toString() {
228                 return
229                 
230                     	toMessage();
231                     
232              }
233 
234              public String toHtmlString() {
235                 return super.toString() +
236             
237             "<b>Id</b> : " +
238             String.valueOf(Id) +
239             " <br/> " +
240             
241             "<b>Target</b> : " +
242             String.valueOf(Target) +
243             " <br/> " +
244             
245             "<b>Location</b> : " +
246             String.valueOf(Location) +
247             " <br/> " +
248              "";
249              }
250 
251              
252              
253              	 public String toMessage() {
254               		StringBuffer buf = new StringBuffer();
255               		buf.append("CHECKREACH");
256               		
257 		    					if (Id != null) {
258 		    						buf.append(" {Id " + Id + "}");
259 		    					}
260 		    				
261 		    					if (Target != null) {
262 		    						buf.append(" {Target " + Target.getStringId() + "}");
263 		    					}
264 		    				
265                                 if (Location != null) {
266                                     buf.append(" {Location " +
267                                         Location.getX() + "," +
268                                         Location.getY() + "," +
269                                         Location.getZ() + "}");
270                                 }
271                             
272             		return buf.toString();
273             }
274              
275              }
276 
277