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                Causes bot to perform usage of a specified trigger. Response to this action is carried by the TRGUSED (TriggerUsed) info message 
34                            Corresponding GameBots command is
35                            USETRG.
36                        
37               */
38              
39              public class
40              UseTrigger extends
41          CommandMessage
42  
43              {
44              
45              /**
46                Creates new instance of command UseTrigger.
47                Causes bot to perform usage of a specified trigger. Response to this action is carried by the TRGUSED (TriggerUsed) info message Corresponding GameBots message for this command is
48                USETRG.
49                    @param Target 
50  			The trigger object to use.
51  		
52                    @param UsableOnly 
53  			If true, the used events associated with the trigger will be checked for their respective activation conditions.
54  		
55                    @param IgnoreEventInteractionDistance 
56  			If true, the interaction distance property of the used events associated with the trigger is ignored (ie. all are tried for activation). The trigger's CylinderComponent still needs to collide
57  			with the player.
58  		
59                */
60               public UseTrigger(
61                  UnrealId Target,  boolean UsableOnly,  boolean IgnoreEventInteractionDistance) {
62                      
63                      this.Target = Target;
64                  
65                      this.UsableOnly = UsableOnly;
66                  
67                      this.IgnoreEventInteractionDistance = IgnoreEventInteractionDistance;
68                  
69                  }
70  
71              
72              		/**
73  		             Creates new instance of command UseTrigger.
74  		             Causes bot to perform usage of a specified trigger. Response to this action is carried by the TRGUSED (TriggerUsed) info message Corresponding GameBots message for this command is
75  		             USETRG.
76  		             <p></p>WARNING: this is empty-command constructor, you have to use setters to fill it up!
77  		             */
78              		public  UseTrigger() {
79              		}
80              	
81  
82              /////// Properties BEGIN
83              
84          /**
85          
86  			The trigger object to use.
87  		 */
88          protected
89           UnrealId Target =
90          	null;
91  
92          
93          /**
94          
95  			The trigger object to use.
96  		 */
97          public
98          UnrealId getTarget() {
99              return
100          Target;
101         }
102         
103 
104         
105             /**
106         
107 			The trigger object to use.
108 		 */
109         public UseTrigger setTarget(UnrealId Target) {
110             this.Target = Target;
111             return this;
112             }
113        
114         /**
115         
116 			If true, the used events associated with the trigger will be checked for their respective activation conditions.
117 		 */
118         protected
119          boolean UsableOnly =
120         	false;
121 
122         
123         /**
124         
125 			If true, the used events associated with the trigger will be checked for their respective activation conditions.
126 		 */
127         public
128         boolean isUsableOnly() {
129             return
130          UsableOnly;
131         }
132         
133 
134         
135             /**
136         
137 			If true, the used events associated with the trigger will be checked for their respective activation conditions.
138 		 */
139         public UseTrigger setUsableOnly(boolean UsableOnly) {
140             this.UsableOnly = UsableOnly;
141             return this;
142             }
143        
144         /**
145         
146 			If true, the interaction distance property of the used events associated with the trigger is ignored (ie. all are tried for activation). The trigger's CylinderComponent still needs to collide
147 			with the player.
148 		 */
149         protected
150          boolean IgnoreEventInteractionDistance =
151         	false;
152 
153         
154         /**
155         
156 			If true, the interaction distance property of the used events associated with the trigger is ignored (ie. all are tried for activation). The trigger's CylinderComponent still needs to collide
157 			with the player.
158 		 */
159         public
160         boolean isIgnoreEventInteractionDistance() {
161             return
162          IgnoreEventInteractionDistance;
163         }
164         
165 
166         
167             /**
168         
169 			If true, the interaction distance property of the used events associated with the trigger is ignored (ie. all are tried for activation). The trigger's CylinderComponent still needs to collide
170 			with the player.
171 		 */
172         public UseTrigger setIgnoreEventInteractionDistance(boolean IgnoreEventInteractionDistance) {
173             this.IgnoreEventInteractionDistance = IgnoreEventInteractionDistance;
174             return this;
175             }
176        
177             /////// Properties END
178 
179             /////// Extra Java code BEGIN
180 
181             	/////// Additional code from xslt BEGIN
182             		
183 
184 
185             	/////// Additional code from xslt END
186 
187 	            /////// Extra Java from XML BEGIN
188             		
189             	/////// Extra Java from XML END
190 
191             /////// Extra Java code END
192 
193             
194 
195             /**
196               * Cloning constructor.
197               */
198              public UseTrigger(UseTrigger original) {
199                 
200                      this.Target=original.Target;
201                 
202                      this.UsableOnly=original.UsableOnly;
203                 
204                      this.IgnoreEventInteractionDistance=original.IgnoreEventInteractionDistance;
205                 
206              }
207 
208              
209 
210                  
211             public String toString() {
212                 return
213                 
214                     	toMessage();
215                     
216              }
217 
218              public String toHtmlString() {
219                 return super.toString() +
220             
221             "<b>Target</b> : " +
222             String.valueOf(Target) +
223             " <br/> " +
224             
225             "<b>UsableOnly</b> : " +
226             String.valueOf(UsableOnly) +
227             " <br/> " +
228             
229             "<b>IgnoreEventInteractionDistance</b> : " +
230             String.valueOf(IgnoreEventInteractionDistance) +
231             " <br/> " +
232              "";
233              }
234 
235              
236              
237              	 public String toMessage() {
238               		StringBuffer buf = new StringBuffer();
239               		buf.append("USETRG");
240               		
241 		    					if (Target != null) {
242 		    						buf.append(" {Target " + Target.getStringId() + "}");
243 		    					}
244 		    				
245 		    					buf.append(" {UsableOnly " + UsableOnly + "}");
246 		    				
247 		    					buf.append(" {IgnoreEventInteractionDistance " + IgnoreEventInteractionDistance + "}");
248 		    				
249             		return buf.toString();
250             }
251              
252              }
253 
254