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. Sent when the observed player tried to use an object.
35      
36                            Corresponding GameBots message is
37                            TRGUSED.
38                        
39               */
40              
41              public class
42              TriggerUsed
43                      extends GBEvent
44                  
45  	            	implements IWorldEvent, IWorldChangeEvent
46  
47              {
48              
49              /**
50                Creates new instance of command TriggerUsed.
51                
52  		Asynchronous message. Sent when the observed player tried to use an object.
53      Corresponding GameBots message for this command is
54                .
55                    @param Success 
56  			Whether the object was succesfully used
57  		
58                    @param Target 
59  			ID of the actor that was used.
60  		
61                */
62               public TriggerUsed(
63                  boolean Success,  UnrealId Target) {
64                      
65                      this.Success = Success;
66                  
67                      this.Target = Target;
68                  
69                  }
70  
71              
72      	/** Example how the message looks like - used during parser tests. */
73      	public static final String PROTOTYPE =
74      		"TRGUSED {Success False} {Target unreal_id}";
75      
76  
77              /////// Properties BEGIN
78              
79          /**
80          
81  			Whether the object was succesfully used
82  		 */
83          protected
84           boolean Success =
85          	false;
86  
87          
88          /**
89          
90  			Whether the object was succesfully used
91  		 */
92          public
93          boolean isSuccess() {
94              return
95           Success;
96          }
97          
98  
99          
100         /**
101         
102 			ID of the actor that was used.
103 		 */
104         protected
105          UnrealId Target =
106         	null;
107 
108         
109         /**
110         
111 			ID of the actor that was used.
112 		 */
113         public
114         UnrealId getTarget() {
115             return
116          Target;
117         }
118         
119 
120         
121             /////// Properties END
122 
123             /////// Extra Java code BEGIN
124 
125             	/////// Additional code from xslt BEGIN
126             		
127        					public long getSimTime() {
128        						// NOT IMPLEMENTED FOR UDK
129        						return 0;
130        					}
131             		
132 
133 
134             	/////// Additional code from xslt END
135 
136 	            /////// Extra Java from XML BEGIN
137             		
138             	/////// Extra Java from XML END
139 
140             /////// Extra Java code END
141 
142             
143 
144             /**
145               * Cloning constructor.
146               */
147              public TriggerUsed(TriggerUsed original) {
148                 
149                      this.Success=original.Success;
150                 
151                      this.Target=original.Target;
152                 
153              }
154 
155              
156                  /**
157                   * Used by Yylex to create empty message then to fill it's protected fields (Yylex is in the same package).
158                   */
159 	             public TriggerUsed() {
160 	             }
161              
162 
163                  
164             public String toString() {
165                 return
166                 
167                 		super.toString() + " | " +
168                 		
169 				               "Success = " +
170 				               String.valueOf(Success) + " | " +
171 				            
172 				               "Target = " +
173 				               String.valueOf(Target) + " | " +
174 				             "";
175                 	
176              }
177 
178              public String toHtmlString() {
179                 return super.toString() +
180             
181             "<b>Success</b> : " +
182             String.valueOf(Success) +
183             " <br/> " +
184             
185             "<b>Target</b> : " +
186             String.valueOf(Target) +
187             " <br/> " +
188              "";
189              }
190 
191              
192              
193              }
194 
195