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  		Only command that is able to move vehicles. Turn towards target 
35  		specified and move directly to its destination. If there is
36  		an obstacle between target and current position, you will hit it on
37  		your way to target (no obstacle avoidance).
38  	
39                            Corresponding GameBots command is
40                            DRIVETO.
41                        
42               */
43              
44              public class
45              DriveTo extends
46          CommandMessage
47  
48              {
49              
50              /**
51                Creates new instance of command DriveTo.
52                
53  		Only command that is able to move vehicles. Turn towards target 
54  		specified and move directly to its destination. If there is
55  		an obstacle between target and current position, you will hit it on
56  		your way to target (no obstacle avoidance).
57  	Corresponding GameBots message for this command is
58                DRIVETO.
59                    @param Target 
60  			The unique id of a NavPoint, Mover or item (beware, not all of the items
61  			have unique id). Recommended is to specify NavPoint Id as it is always unique.
62  			Won't work with player IDs.
63  		
64                */
65               public DriveTo(
66                  UnrealId Target) {
67                      
68                      this.Target = Target;
69                  
70                  }
71  
72              
73              		/**
74  		             Creates new instance of command DriveTo.
75  		             
76  		Only command that is able to move vehicles. Turn towards target 
77  		specified and move directly to its destination. If there is
78  		an obstacle between target and current position, you will hit it on
79  		your way to target (no obstacle avoidance).
80  	Corresponding GameBots message for this command is
81  		             DRIVETO.
82  		             <p></p>WARNING: this is empty-command constructor, you have to use setters to fill it up!
83  		             */
84              		public  DriveTo() {
85              		}
86              	
87  
88              /////// Properties BEGIN
89              
90          /**
91          
92  			The unique id of a NavPoint, Mover or item (beware, not all of the items
93  			have unique id). Recommended is to specify NavPoint Id as it is always unique.
94  			Won't work with player IDs.
95  		 */
96          protected
97           UnrealId Target =
98          	null;
99  
100         
101         /**
102         
103 			The unique id of a NavPoint, Mover or item (beware, not all of the items
104 			have unique id). Recommended is to specify NavPoint Id as it is always unique.
105 			Won't work with player IDs.
106 		 */
107         public
108         UnrealId getTarget() {
109             return
110          Target;
111         }
112         
113 
114         
115             /**
116         
117 			The unique id of a NavPoint, Mover or item (beware, not all of the items
118 			have unique id). Recommended is to specify NavPoint Id as it is always unique.
119 			Won't work with player IDs.
120 		 */
121         public DriveTo setTarget(UnrealId Target) {
122             this.Target = Target;
123             return this;
124             }
125        
126             /////// Properties END
127 
128             /////// Extra Java code BEGIN
129 
130             	/////// Additional code from xslt BEGIN
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 DriveTo(DriveTo original) {
148                 
149                      this.Target=original.Target;
150                 
151              }
152 
153              
154 
155                  
156             public String toString() {
157                 return
158                 
159                     	toMessage();
160                     
161              }
162 
163              public String toHtmlString() {
164                 return super.toString() +
165             
166             "<b>Target</b> : " +
167             String.valueOf(Target) +
168             " <br/> " +
169              "";
170              }
171 
172              
173              
174              	 public String toMessage() {
175               		StringBuffer buf = new StringBuffer();
176               		buf.append("DRIVETO");
177               		
178 		    					if (Target != null) {
179 		    						buf.append(" {Target " + Target.getStringId() + "}");
180 		    					}
181 		    				
182             		return buf.toString();
183             }
184              
185              }
186 
187