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  		Command for changing the bot team. Responds with TEAMCHANGE
35  		message. This command can be issued also by bot on the bot
36  		itself (in this case Id attribute is not parsed).
37  	
38                            Corresponding GameBots command is
39                            CHANGETEAM.
40                        
41               */
42              
43              public class
44              ChangeTeam extends
45          CommandMessage
46  
47              {
48              
49              /**
50                Creates new instance of command ChangeTeam.
51                
52  		Command for changing the bot team. Responds with TEAMCHANGE
53  		message. This command can be issued also by bot on the bot
54  		itself (in this case Id attribute is not parsed).
55  	Corresponding GameBots message for this command is
56                CHANGETEAM.
57                    @param Id 
58  			Id of the target bot (won't be parsed if sent to bot
59  			connection).
60  		
61                    @param Team 
62  			This is the team we want to change to (0 for red, 1 for
63  			blue, etc.).
64  		
65                */
66               public ChangeTeam(
67                  UnrealId Id,  int Team) {
68                      
69                      this.Id = Id;
70                  
71                      this.Team = Team;
72                  
73                  }
74  
75              
76              		/**
77  		             Creates new instance of command ChangeTeam.
78  		             
79  		Command for changing the bot team. Responds with TEAMCHANGE
80  		message. This command can be issued also by bot on the bot
81  		itself (in this case Id attribute is not parsed).
82  	Corresponding GameBots message for this command is
83  		             CHANGETEAM.
84  		             <p></p>WARNING: this is empty-command constructor, you have to use setters to fill it up!
85  		             */
86              		public  ChangeTeam() {
87              		}
88              	
89  
90              /////// Properties BEGIN
91              
92          /**
93          
94  			Id of the target bot (won't be parsed if sent to bot
95  			connection).
96  		 */
97          protected
98           UnrealId Id =
99          	null;
100 
101         
102         /**
103         
104 			Id of the target bot (won't be parsed if sent to bot
105 			connection).
106 		 */
107         public
108         UnrealId getId() {
109             return
110          Id;
111         }
112         
113 
114         
115             /**
116         
117 			Id of the target bot (won't be parsed if sent to bot
118 			connection).
119 		 */
120         public ChangeTeam setId(UnrealId Id) {
121             this.Id = Id;
122             return this;
123             }
124        
125         /**
126         
127 			This is the team we want to change to (0 for red, 1 for
128 			blue, etc.).
129 		 */
130         protected
131          int Team =
132         	0;
133 
134         
135         /**
136         
137 			This is the team we want to change to (0 for red, 1 for
138 			blue, etc.).
139 		 */
140         public
141         int getTeam() {
142             return
143          Team;
144         }
145         
146 
147         
148             /**
149         
150 			This is the team we want to change to (0 for red, 1 for
151 			blue, etc.).
152 		 */
153         public ChangeTeam setTeam(int Team) {
154             this.Team = Team;
155             return this;
156             }
157        
158             /////// Properties END
159 
160             /////// Extra Java code BEGIN
161 
162             	/////// Additional code from xslt BEGIN
163             		
164 
165 
166             	/////// Additional code from xslt END
167 
168 	            /////// Extra Java from XML BEGIN
169             		
170             	/////// Extra Java from XML END
171 
172             /////// Extra Java code END
173 
174             
175 
176             /**
177               * Cloning constructor.
178               */
179              public ChangeTeam(ChangeTeam original) {
180                 
181                      this.Id=original.Id;
182                 
183                      this.Team=original.Team;
184                 
185              }
186 
187              
188 
189                  
190             public String toString() {
191                 return
192                 
193                     	toMessage();
194                     
195              }
196 
197              public String toHtmlString() {
198                 return super.toString() +
199             
200             "<b>Id</b> : " +
201             String.valueOf(Id) +
202             " <br/> " +
203             
204             "<b>Team</b> : " +
205             String.valueOf(Team) +
206             " <br/> " +
207              "";
208              }
209 
210              
211              
212              	 public String toMessage() {
213               		StringBuffer buf = new StringBuffer();
214               		buf.append("CHANGETEAM");
215               		
216 		    					if (Id != null) {
217 		    						buf.append(" {Id " + Id.getStringId() + "}");
218 		    					}
219 		    				
220 		    					buf.append(" {Team " + Team + "}");
221 		    				
222             		return buf.toString();
223             }
224              
225              }
226 
227