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 THAT FILE INSTEAD OF THIS ONE.
7            
8            Use Ant task process-gb-messages after that to generate .java files again.
9            
10           IMPORTANT END !!!
11          */
12   	package cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands;import java.util.*;import javax.vecmath.*;import cz.cuni.amis.pogamut.base.communication.messages.*;import cz.cuni.amis.pogamut.base.communication.worldview.*;import cz.cuni.amis.pogamut.base.communication.worldview.event.*;import cz.cuni.amis.pogamut.base.communication.worldview.object.*;import cz.cuni.amis.pogamut.multi.communication.worldview.object.*;import cz.cuni.amis.pogamut.base.communication.translator.event.*;import cz.cuni.amis.pogamut.multi.communication.translator.event.*;import cz.cuni.amis.pogamut.base3d.worldview.object.*;import cz.cuni.amis.pogamut.base3d.worldview.object.event.*;import cz.cuni.amis.pogamut.ut2004.communication.messages.*;import cz.cuni.amis.pogamut.ut2004.communication.worldview.objects.*;import cz.cuni.amis.pogamut.ut2004multi.communication.worldview.objects.*;import cz.cuni.amis.pogamut.ut2004.communication.translator.itemdescriptor.*;import cz.cuni.amis.pogamut.ut2004.communication.messages.ItemType.Category;import cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId;import cz.cuni.amis.utils.exception.*;import cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result;import cz.cuni.amis.utils.SafeEquals;import cz.cuni.amis.pogamut.base.agent.*;import cz.cuni.amis.pogamut.multi.agent.*;import cz.cuni.amis.pogamut.multi.communication.worldview.property.*;import cz.cuni.amis.pogamut.ut2004multi.communication.worldview.property.*;import cz.cuni.amis.utils.token.*;import cz.cuni.amis.utils.*;
13   		/**
14   		 * Representation of the GameBots2004 command SHOOT.
15   		 *
16   		 * 
17  		Start firing your weapon (until receives STOPSHOOT command, or
18  		run out of ammo or die).
19  	
20           */
21   	public class Shoot 
22  		extends CommandMessage
23  	        {
24  	        	
25  		        
26      	/** Example how the message looks like - used during parser tests. */
27      	public static final String PROTOTYPE =
28      		" {Location 0,0,0}  {Target unreal_id}  {Alt False} ";
29      
30  		/**
31  		 * Creates new instance of command Shoot.
32  		 * 
33  		Start firing your weapon (until receives STOPSHOOT command, or
34  		run out of ammo or die).
35  	
36  		 * Corresponding GameBots message for this command is
37  		 * SHOOT.
38  		 *
39  		 * 
40  		 *    @param Location Location you want to shoot at.
41  		 *    @param Target 
42  			The unique Id of your target. If you specify a target, and
43  			it is visible to you, the server will provide aim correction
44  			and target leading for you. If not you just shoot at the
45  			location specified.
46  		
47  		 *    @param Alt 
48  			If you send True to this you will alt fire instead of normal
49  			fire. For normal fire you don't need to send this argument
50  			at all.
51  		
52  		 */
53  		public Shoot(
54  			Location Location,  UnrealId Target,  Boolean Alt
55  		) {
56  			
57  				this.Location = Location;
58              
59  				this.Target = Target;
60              
61  				this.Alt = Alt;
62              
63  		}
64  
65  		
66  			/**
67  			 * Creates new instance of command Shoot.
68  			 * 
69  		Start firing your weapon (until receives STOPSHOOT command, or
70  		run out of ammo or die).
71  	
72  			 * Corresponding GameBots message for this command is
73  			 * SHOOT.
74  			 * <p></p>
75  			 * WARNING: this is empty-command constructor, you have to use setters to fill it up with data that should be sent to GameBots2004!
76  		     */
77  		    public Shoot() {
78  		    }
79  			
80  		
81  		/**
82  		 * Cloning constructor.
83  		 *
84  		 * @param original
85  		 */
86  		public Shoot(Shoot original) {
87  		   
88  		        this.Location = original.Location;
89  		   
90  		        this.Target = original.Target;
91  		   
92  		        this.Alt = original.Alt;
93  		   
94  		}
95      
96  	        /**
97  	        Location you want to shoot at. 
98  	        */
99  	        protected
100 	         Location Location =
101 	       	
102 	        		null
103 	        	;
104 	
105 	        
106 	        
107  		/**
108          * Location you want to shoot at. 
109          */
110         public Location getLocation()
111  	
112 	        {
113 	            return
114 	        	 Location;
115 	        }
116 	        
117 	        
118 	        
119  		
120  		/**
121          * Location you want to shoot at. 
122          */
123         public Shoot 
124         setLocation(Location Location)
125  	
126 			{
127 				this.Location = Location;
128 				return this;
129 			}
130 		
131 	        /**
132 	        
133 			The unique Id of your target. If you specify a target, and
134 			it is visible to you, the server will provide aim correction
135 			and target leading for you. If not you just shoot at the
136 			location specified.
137 		 
138 	        */
139 	        protected
140 	         UnrealId Target =
141 	       	
142 	        		null
143 	        	;
144 	
145 	        
146 	        
147  		/**
148          * 
149 			The unique Id of your target. If you specify a target, and
150 			it is visible to you, the server will provide aim correction
151 			and target leading for you. If not you just shoot at the
152 			location specified.
153 		 
154          */
155         public UnrealId getTarget()
156  	
157 	        {
158 	            return
159 	        	 Target;
160 	        }
161 	        
162 	        
163 	        
164  		
165  		/**
166          * 
167 			The unique Id of your target. If you specify a target, and
168 			it is visible to you, the server will provide aim correction
169 			and target leading for you. If not you just shoot at the
170 			location specified.
171 		 
172          */
173         public Shoot 
174         setTarget(UnrealId Target)
175  	
176 			{
177 				this.Target = Target;
178 				return this;
179 			}
180 		
181 	        /**
182 	        
183 			If you send True to this you will alt fire instead of normal
184 			fire. For normal fire you don't need to send this argument
185 			at all.
186 		 
187 	        */
188 	        protected
189 	         Boolean Alt =
190 	       	
191 	        		null
192 	        	;
193 	
194 	        
195 	        
196  		/**
197          * 
198 			If you send True to this you will alt fire instead of normal
199 			fire. For normal fire you don't need to send this argument
200 			at all.
201 		 
202          */
203         public Boolean isAlt()
204  	
205 	        {
206 	            return
207 	        	 Alt;
208 	        }
209 	        
210 	        
211 	        
212  		
213  		/**
214          * 
215 			If you send True to this you will alt fire instead of normal
216 			fire. For normal fire you don't need to send this argument
217 			at all.
218 		 
219          */
220         public Shoot 
221         setAlt(Boolean Alt)
222  	
223 			{
224 				this.Alt = Alt;
225 				return this;
226 			}
227 		
228  	    public String toString() {
229             return toMessage();
230         }
231  	
232  		public String toHtmlString() {
233 			return super.toString() + "[<br/>" +
234             	
235             	"<b>Location</b> = " +
236             	String.valueOf(getLocation()
237  	) +
238             	" <br/> " +
239             	
240             	"<b>Target</b> = " +
241             	String.valueOf(getTarget()
242  	) +
243             	" <br/> " +
244             	
245             	"<b>Alt</b> = " +
246             	String.valueOf(isAlt()
247  	) +
248             	" <br/> " +
249             	 
250             	"<br/>]"
251             ;
252 		}
253  	
254 		public String toMessage() {
255      		StringBuffer buf = new StringBuffer();
256      		buf.append("SHOOT");
257      		
258 					    if (Location != null) {
259 					        buf.append(" {Location " +
260 					            Location.getX() + "," +
261 					            Location.getY() + "," +
262 					            Location.getZ() + "}");
263 					    }
264 					
265 						if (Target != null) {
266 							buf.append(" {Target " + Target.getStringId() + "}");
267 						}
268 					
269 						if (Alt != null) {
270 							buf.append(" {Alt " + Alt + "}");
271 						}
272 					
273    			return buf.toString();
274    		}
275  	
276  		// --- Extra Java from XML BEGIN (extra/code/java)
277         	
278 		// --- Extra Java from XML END (extra/code/java)
279  	
280 	        }
281