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