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 SETLOCK.
15   		 *
16   		 * 
17  		Will disable new connections to bot server and or control server
18  		- depends on parameters. If last ControlServer instance is
19  		leaving. ControlServer lock will be canceled.
20  	
21           */
22   	public class SetLock 
23  		extends CommandMessage
24  	        {
25  	        	
26  		        
27      	/** Example how the message looks like - used during parser tests. */
28      	public static final String PROTOTYPE =
29      		" {BotServer False}  {ControlServer False} ";
30      
31  		/**
32  		 * Creates new instance of command SetLock.
33  		 * 
34  		Will disable new connections to bot server and or control server
35  		- depends on parameters. If last ControlServer instance is
36  		leaving. ControlServer lock will be canceled.
37  	
38  		 * Corresponding GameBots message for this command is
39  		 * SETLOCK.
40  		 *
41  		 * 
42  		 *    @param BotServer 
43  			If BotConnections should be locked.
44  		
45  		 *    @param ControlServer 
46  			If ControlConnections (server connections) should be locked.
47  		
48  		 */
49  		public SetLock(
50  			Boolean BotServer,  Boolean ControlServer
51  		) {
52  			
53  				this.BotServer = BotServer;
54              
55  				this.ControlServer = ControlServer;
56              
57  		}
58  
59  		
60  			/**
61  			 * Creates new instance of command SetLock.
62  			 * 
63  		Will disable new connections to bot server and or control server
64  		- depends on parameters. If last ControlServer instance is
65  		leaving. ControlServer lock will be canceled.
66  	
67  			 * Corresponding GameBots message for this command is
68  			 * SETLOCK.
69  			 * <p></p>
70  			 * WARNING: this is empty-command constructor, you have to use setters to fill it up with data that should be sent to GameBots2004!
71  		     */
72  		    public SetLock() {
73  		    }
74  			
75  		
76  		/**
77  		 * Cloning constructor.
78  		 *
79  		 * @param original
80  		 */
81  		public SetLock(SetLock original) {
82  		   
83  		        this.BotServer = original.BotServer;
84  		   
85  		        this.ControlServer = original.ControlServer;
86  		   
87  		}
88      
89  	        /**
90  	        
91  			If BotConnections should be locked.
92  		 
93  	        */
94  	        protected
95  	         Boolean BotServer =
96  	       	
97  	        		null
98  	        	;
99  	
100 	        
101 	        
102  		/**
103          * 
104 			If BotConnections should be locked.
105 		 
106          */
107         public Boolean isBotServer()
108  	
109 	        {
110 	            return
111 	        	 BotServer;
112 	        }
113 	        
114 	        
115 	        
116  		
117  		/**
118          * 
119 			If BotConnections should be locked.
120 		 
121          */
122         public SetLock 
123         setBotServer(Boolean BotServer)
124  	
125 			{
126 				this.BotServer = BotServer;
127 				return this;
128 			}
129 		
130 	        /**
131 	        
132 			If ControlConnections (server connections) should be locked.
133 		 
134 	        */
135 	        protected
136 	         Boolean ControlServer =
137 	       	
138 	        		null
139 	        	;
140 	
141 	        
142 	        
143  		/**
144          * 
145 			If ControlConnections (server connections) should be locked.
146 		 
147          */
148         public Boolean isControlServer()
149  	
150 	        {
151 	            return
152 	        	 ControlServer;
153 	        }
154 	        
155 	        
156 	        
157  		
158  		/**
159          * 
160 			If ControlConnections (server connections) should be locked.
161 		 
162          */
163         public SetLock 
164         setControlServer(Boolean ControlServer)
165  	
166 			{
167 				this.ControlServer = ControlServer;
168 				return this;
169 			}
170 		
171  	    public String toString() {
172             return toMessage();
173         }
174  	
175  		public String toHtmlString() {
176 			return super.toString() + "[<br/>" +
177             	
178             	"<b>BotServer</b> = " +
179             	String.valueOf(isBotServer()
180  	) +
181             	" <br/> " +
182             	
183             	"<b>ControlServer</b> = " +
184             	String.valueOf(isControlServer()
185  	) +
186             	" <br/> " +
187             	 
188             	"<br/>]"
189             ;
190 		}
191  	
192 		public String toMessage() {
193      		StringBuffer buf = new StringBuffer();
194      		buf.append("SETLOCK");
195      		
196 						if (BotServer != null) {
197 							buf.append(" {BotServer " + BotServer + "}");
198 						}
199 					
200 						if (ControlServer != null) {
201 							buf.append(" {ControlServer " + ControlServer + "}");
202 						}
203 					
204    			return buf.toString();
205    		}
206  	
207  		// --- Extra Java from XML BEGIN (extra/code/java)
208         	
209 		// --- Extra Java from XML END (extra/code/java)
210  	
211 	        }
212