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 THAT FILE INSTEAD OF THIS ONE.
7            
8            Use Ant task process-gb-messages after that to generate .java files again.
9            
10           IMPORTANT END !!!
11          */
12   	package cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands;import java.util.*;import javax.vecmath.*;import cz.cuni.amis.pogamut.base.communication.messages.*;import cz.cuni.amis.pogamut.base.communication.worldview.*;import cz.cuni.amis.pogamut.base.communication.worldview.event.*;import cz.cuni.amis.pogamut.base.communication.worldview.object.*;import cz.cuni.amis.pogamut.multi.communication.worldview.object.*;import cz.cuni.amis.pogamut.base.communication.translator.event.*;import cz.cuni.amis.pogamut.multi.communication.translator.event.*;import cz.cuni.amis.pogamut.base3d.worldview.object.*;import cz.cuni.amis.pogamut.base3d.worldview.object.event.*;import cz.cuni.amis.pogamut.ut2004.communication.messages.*;import cz.cuni.amis.pogamut.ut2004.communication.worldview.objects.*;import cz.cuni.amis.pogamut.ut2004multi.communication.worldview.objects.*;import cz.cuni.amis.pogamut.ut2004.communication.translator.itemdescriptor.*;import cz.cuni.amis.pogamut.ut2004.communication.messages.ItemType.Category;import cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId;import cz.cuni.amis.utils.exception.*;import cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdateResult.Result;import cz.cuni.amis.utils.SafeEquals;import cz.cuni.amis.pogamut.base.agent.*;import cz.cuni.amis.pogamut.multi.agent.*;import cz.cuni.amis.pogamut.multi.communication.worldview.property.*;import cz.cuni.amis.pogamut.ut2004multi.communication.worldview.property.*;import cz.cuni.amis.utils.token.*;import cz.cuni.amis.utils.*;
13   		/**
14   		 * Representation of the GameBots2004 command CONFGAME.
15   		 *
16   		 * 
17  		Configures various attributes of the game.
18      
19           */
20   	public class GameConfiguration 
21  		extends CommandMessage
22  	        {
23  	        	
24  		        
25      	/** Example how the message looks like - used during parser tests. */
26      	public static final String PROTOTYPE =
27      		" {Restart False}  {GameMessage text}  {GameMessageTime 0} ";
28      
29  		/**
30  		 * Creates new instance of command GameConfiguration.
31  		 * 
32  		Configures various attributes of the game.
33      
34  		 * Corresponding GameBots message for this command is
35  		 * CONFGAME.
36  		 *
37  		 * 
38  		 *    @param Restart 
39  		When set to true, the game state will be restarted (all scores reset to
40                  0 and all players and bots will be restarted). This does not affect
41                  Unreal native bots! Note that the restart is then announced by GameRestarted message and when finished
42                  another GameRestarted message is sent to mark the end.
43          
44  		 *    @param GameMessage 
45  		Message that will be displayed in the middle of the HUD.
46          
47  		 *    @param GameMessageTime 
48  		Time the displayed message will stay on the HUD.
49          
50  		 */
51  		public GameConfiguration(
52  			Boolean Restart,  String GameMessage,  Double GameMessageTime
53  		) {
54  			
55  				this.Restart = Restart;
56              
57  				this.GameMessage = GameMessage;
58              
59  				this.GameMessageTime = GameMessageTime;
60              
61  		}
62  
63  		
64  			/**
65  			 * Creates new instance of command GameConfiguration.
66  			 * 
67  		Configures various attributes of the game.
68      
69  			 * Corresponding GameBots message for this command is
70  			 * CONFGAME.
71  			 * <p></p>
72  			 * WARNING: this is empty-command constructor, you have to use setters to fill it up with data that should be sent to GameBots2004!
73  		     */
74  		    public GameConfiguration() {
75  		    }
76  			
77  		
78  		/**
79  		 * Cloning constructor.
80  		 *
81  		 * @param original
82  		 */
83  		public GameConfiguration(GameConfiguration original) {
84  		   
85  		        this.Restart = original.Restart;
86  		   
87  		        this.GameMessage = original.GameMessage;
88  		   
89  		        this.GameMessageTime = original.GameMessageTime;
90  		   
91  		}
92      
93  	        /**
94  	        
95  		When set to true, the game state will be restarted (all scores reset to
96                  0 and all players and bots will be restarted). This does not affect
97                  Unreal native bots! Note that the restart is then announced by GameRestarted message and when finished
98                  another GameRestarted message is sent to mark the end.
99           
100 	        */
101 	        protected
102 	         Boolean Restart =
103 	       	
104 	        		null
105 	        	;
106 	
107 	        
108 	        
109  		/**
110          * 
111 		When set to true, the game state will be restarted (all scores reset to
112                 0 and all players and bots will be restarted). This does not affect
113                 Unreal native bots! Note that the restart is then announced by GameRestarted message and when finished
114                 another GameRestarted message is sent to mark the end.
115          
116          */
117         public Boolean isRestart()
118  	
119 	        {
120 	            return
121 	        	 Restart;
122 	        }
123 	        
124 	        
125 	        
126  		
127  		/**
128          * 
129 		When set to true, the game state will be restarted (all scores reset to
130                 0 and all players and bots will be restarted). This does not affect
131                 Unreal native bots! Note that the restart is then announced by GameRestarted message and when finished
132                 another GameRestarted message is sent to mark the end.
133          
134          */
135         public GameConfiguration 
136         setRestart(Boolean Restart)
137  	
138 			{
139 				this.Restart = Restart;
140 				return this;
141 			}
142 		
143 	        /**
144 	        
145 		Message that will be displayed in the middle of the HUD.
146          
147 	        */
148 	        protected
149 	         String GameMessage =
150 	       	
151 	        		null
152 	        	;
153 	
154 	        
155 	        
156  		/**
157          * 
158 		Message that will be displayed in the middle of the HUD.
159          
160          */
161         public String getGameMessage()
162  	
163 	        {
164 	            return
165 	        	 GameMessage;
166 	        }
167 	        
168 	        
169 	        
170  		
171  		/**
172          * 
173 		Message that will be displayed in the middle of the HUD.
174          
175          */
176         public GameConfiguration 
177         setGameMessage(String GameMessage)
178  	
179 			{
180 				this.GameMessage = GameMessage;
181 				return this;
182 			}
183 		
184 	        /**
185 	        
186 		Time the displayed message will stay on the HUD.
187          
188 	        */
189 	        protected
190 	         Double GameMessageTime =
191 	       	
192 	        		null
193 	        	;
194 	
195 	        
196 	        
197  		/**
198          * 
199 		Time the displayed message will stay on the HUD.
200          
201          */
202         public Double getGameMessageTime()
203  	
204 	        {
205 	            return
206 	        	 GameMessageTime;
207 	        }
208 	        
209 	        
210 	        
211  		
212  		/**
213          * 
214 		Time the displayed message will stay on the HUD.
215          
216          */
217         public GameConfiguration 
218         setGameMessageTime(Double GameMessageTime)
219  	
220 			{
221 				this.GameMessageTime = GameMessageTime;
222 				return this;
223 			}
224 		
225  	    public String toString() {
226             return toMessage();
227         }
228  	
229  		public String toHtmlString() {
230 			return super.toString() + "[<br/>" +
231             	
232             	"<b>Restart</b> = " +
233             	String.valueOf(isRestart()
234  	) +
235             	" <br/> " +
236             	
237             	"<b>GameMessage</b> = " +
238             	String.valueOf(getGameMessage()
239  	) +
240             	" <br/> " +
241             	
242             	"<b>GameMessageTime</b> = " +
243             	String.valueOf(getGameMessageTime()
244  	) +
245             	" <br/> " +
246             	 
247             	"<br/>]"
248             ;
249 		}
250  	
251 		public String toMessage() {
252      		StringBuffer buf = new StringBuffer();
253      		buf.append("CONFGAME");
254      		
255 						if (Restart != null) {
256 							buf.append(" {Restart " + Restart + "}");
257 						}
258 					
259 						if (GameMessage != null) {
260 							buf.append(" {GameMessage " + GameMessage + "}");
261 						}
262 					
263 						if (GameMessageTime != null) {
264 							buf.append(" {GameMessageTime " + GameMessageTime + "}");
265 						}
266 					
267    			return buf.toString();
268    		}
269  	
270  		// --- Extra Java from XML BEGIN (extra/code/java)
271         	
272 		// --- Extra Java from XML END (extra/code/java)
273  	
274 	        }
275