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. Player selected an object in the environment in PlayerMousing state (by pressing ALT + SHIFT to switch to this state).
35  	
36                            Corresponding GameBots message is
37                            SEL.
38                        
39               */
40              
41              public class
42              ObjectSelected
43                      extends GBEvent
44                  
45  	            	implements IWorldEvent, IWorldChangeEvent
46  
47              {
48              
49              /**
50                Creates new instance of command ObjectSelected.
51                
52  		Asynchronous message. Player selected an object in the environment in PlayerMousing state (by pressing ALT + SHIFT to switch to this state).
53  	Corresponding GameBots message for this command is
54                .
55                    @param PlayerId 
56  			Unique Id of the player that this event is for.
57  		
58                    @param PlayerName 
59  			Name of the player that this event is for.
60  		
61                    @param ObjectId 
62  			Id of the actor the player selected (actors include
63  			other players or bots and other physical objects that can
64  			block your path and even level geometry actors). Will be "None" if nothing was selected (or actor was deselected).
65  		
66                    @param ObjectLocation 
67  			Location of the actor the player selected. Sent only if some object selected.
68  		
69                    @param ObjectHitLocation 
70  			Location of the hit point that we have selected this actor through. Sent only if some object selected.
71  		
72                */
73               public ObjectSelected(
74                  UnrealId PlayerId,  String PlayerName,  UnrealId ObjectId,  Location ObjectLocation,  Location ObjectHitLocation) {
75                      
76                      this.PlayerId = PlayerId;
77                  
78                      this.PlayerName = PlayerName;
79                  
80                      this.ObjectId = ObjectId;
81                  
82                      this.ObjectLocation = ObjectLocation;
83                  
84                      this.ObjectHitLocation = ObjectHitLocation;
85                  
86                  }
87  
88              
89      	/** Example how the message looks like - used during parser tests. */
90      	public static final String PROTOTYPE =
91      		"SEL {PlayerId unreal_id} {PlayerName text} {ObjectId unreal_id} {ObjectLocation 0,0,0} {ObjectHitLocation 0,0,0}";
92      
93  
94              /////// Properties BEGIN
95              
96          /**
97          
98  			Unique Id of the player that this event is for.
99  		 */
100         protected
101          UnrealId PlayerId =
102         	null;
103 
104         
105         /**
106         
107 			Unique Id of the player that this event is for.
108 		 */
109         public
110         UnrealId getPlayerId() {
111             return
112          PlayerId;
113         }
114         
115 
116         
117         /**
118         
119 			Name of the player that this event is for.
120 		 */
121         protected
122          String PlayerName =
123         	null;
124 
125         
126         /**
127         
128 			Name of the player that this event is for.
129 		 */
130         public
131         String getPlayerName() {
132             return
133          PlayerName;
134         }
135         
136 
137         
138         /**
139         
140 			Id of the actor the player selected (actors include
141 			other players or bots and other physical objects that can
142 			block your path and even level geometry actors). Will be "None" if nothing was selected (or actor was deselected).
143 		 */
144         protected
145          UnrealId ObjectId =
146         	null;
147 
148         
149         /**
150         
151 			Id of the actor the player selected (actors include
152 			other players or bots and other physical objects that can
153 			block your path and even level geometry actors). Will be "None" if nothing was selected (or actor was deselected).
154 		 */
155         public
156         UnrealId getObjectId() {
157             return
158          ObjectId;
159         }
160         
161 
162         
163         /**
164         
165 			Location of the actor the player selected. Sent only if some object selected.
166 		 */
167         protected
168          Location ObjectLocation =
169         	null;
170 
171         
172         /**
173         
174 			Location of the actor the player selected. Sent only if some object selected.
175 		 */
176         public
177         Location getObjectLocation() {
178             return
179          ObjectLocation;
180         }
181         
182 
183         
184         /**
185         
186 			Location of the hit point that we have selected this actor through. Sent only if some object selected.
187 		 */
188         protected
189          Location ObjectHitLocation =
190         	null;
191 
192         
193         /**
194         
195 			Location of the hit point that we have selected this actor through. Sent only if some object selected.
196 		 */
197         public
198         Location getObjectHitLocation() {
199             return
200          ObjectHitLocation;
201         }
202         
203 
204         
205             /////// Properties END
206 
207             /////// Extra Java code BEGIN
208 
209             	/////// Additional code from xslt BEGIN
210             		
211        					public long getSimTime() {
212        						// NOT IMPLEMENTED FOR UDK
213        						return 0;
214        					}
215             		
216 
217 
218             	/////// Additional code from xslt END
219 
220 	            /////// Extra Java from XML BEGIN
221             		
222             	/////// Extra Java from XML END
223 
224             /////// Extra Java code END
225 
226             
227 
228             /**
229               * Cloning constructor.
230               */
231              public ObjectSelected(ObjectSelected original) {
232                 
233                      this.PlayerId=original.PlayerId;
234                 
235                      this.PlayerName=original.PlayerName;
236                 
237                      this.ObjectId=original.ObjectId;
238                 
239                      this.ObjectLocation=original.ObjectLocation;
240                 
241                      this.ObjectHitLocation=original.ObjectHitLocation;
242                 
243              }
244 
245              
246                  /**
247                   * Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
248                   */
249 	             public ObjectSelected() {
250 	             }
251              
252 
253                  
254             public String toString() {
255                 return
256                 
257                 		super.toString() + " | " +
258                 		
259 				               "PlayerId = " +
260 				               String.valueOf(PlayerId) + " | " +
261 				            
262 				               "PlayerName = " +
263 				               String.valueOf(PlayerName) + " | " +
264 				            
265 				               "ObjectId = " +
266 				               String.valueOf(ObjectId) + " | " +
267 				            
268 				               "ObjectLocation = " +
269 				               String.valueOf(ObjectLocation) + " | " +
270 				            
271 				               "ObjectHitLocation = " +
272 				               String.valueOf(ObjectHitLocation) + " | " +
273 				             "";
274                 	
275              }
276 
277              public String toHtmlString() {
278                 return super.toString() +
279             
280             "<b>PlayerId</b> : " +
281             String.valueOf(PlayerId) +
282             " <br/> " +
283             
284             "<b>PlayerName</b> : " +
285             String.valueOf(PlayerName) +
286             " <br/> " +
287             
288             "<b>ObjectId</b> : " +
289             String.valueOf(ObjectId) +
290             " <br/> " +
291             
292             "<b>ObjectLocation</b> : " +
293             String.valueOf(ObjectLocation) +
294             " <br/> " +
295             
296             "<b>ObjectHitLocation</b> : " +
297             String.valueOf(ObjectHitLocation) +
298             " <br/> " +
299              "";
300              }
301 
302              
303              
304              }
305 
306