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 SETSENDKEYS.
15   		 *
16   		 * 
17  		Sets whether all key (not mouse) events should be sent through the KEYEVENT message.
18  	
19           */
20   	public class SetSendKeys 
21  		extends CommandMessage
22  	        {
23  	        	
24  		        
25      	/** Example how the message looks like - used during parser tests. */
26      	public static final String PROTOTYPE =
27      		" {PlayerId unreal_id}  {Player text}  {Send False} ";
28      
29  		/**
30  		 * Creates new instance of command SetSendKeys.
31  		 * 
32  		Sets whether all key (not mouse) events should be sent through the KEYEVENT message.
33  	
34  		 * Corresponding GameBots message for this command is
35  		 * SETSENDKEYS.
36  		 *
37  		 * 
38  		 *    @param PlayerId Id of the affected player. Used in GBUE2.
39  		 *    @param Player Name of the affected player. Used in GBScenario.
40  		 *    @param Send If true, the player can behave normally. If false, the player cannot perform any action.
41  		 */
42  		public SetSendKeys(
43  			UnrealId PlayerId,  String Player,  Boolean Send
44  		) {
45  			
46  				this.PlayerId = PlayerId;
47              
48  				this.Player = Player;
49              
50  				this.Send = Send;
51              
52  		}
53  
54  		
55  			/**
56  			 * Creates new instance of command SetSendKeys.
57  			 * 
58  		Sets whether all key (not mouse) events should be sent through the KEYEVENT message.
59  	
60  			 * Corresponding GameBots message for this command is
61  			 * SETSENDKEYS.
62  			 * <p></p>
63  			 * WARNING: this is empty-command constructor, you have to use setters to fill it up with data that should be sent to GameBots2004!
64  		     */
65  		    public SetSendKeys() {
66  		    }
67  			
68  		
69  		/**
70  		 * Cloning constructor.
71  		 *
72  		 * @param original
73  		 */
74  		public SetSendKeys(SetSendKeys original) {
75  		   
76  		        this.PlayerId = original.PlayerId;
77  		   
78  		        this.Player = original.Player;
79  		   
80  		        this.Send = original.Send;
81  		   
82  		}
83      
84  	        /**
85  	        Id of the affected player. Used in GBUE2. 
86  	        */
87  	        protected
88  	         UnrealId PlayerId =
89  	       	
90  	        		null
91  	        	;
92  	
93  	        
94  	        
95   		/**
96           * Id of the affected player. Used in GBUE2. 
97           */
98          public UnrealId getPlayerId()
99   	
100 	        {
101 	            return
102 	        	 PlayerId;
103 	        }
104 	        
105 	        
106 	        
107  		
108  		/**
109          * Id of the affected player. Used in GBUE2. 
110          */
111         public SetSendKeys 
112         setPlayerId(UnrealId PlayerId)
113  	
114 			{
115 				this.PlayerId = PlayerId;
116 				return this;
117 			}
118 		
119 	        /**
120 	        Name of the affected player. Used in GBScenario. 
121 	        */
122 	        protected
123 	         String Player =
124 	       	
125 	        		null
126 	        	;
127 	
128 	        
129 	        
130  		/**
131          * Name of the affected player. Used in GBScenario. 
132          */
133         public String getPlayer()
134  	
135 	        {
136 	            return
137 	        	 Player;
138 	        }
139 	        
140 	        
141 	        
142  		
143  		/**
144          * Name of the affected player. Used in GBScenario. 
145          */
146         public SetSendKeys 
147         setPlayer(String Player)
148  	
149 			{
150 				this.Player = Player;
151 				return this;
152 			}
153 		
154 	        /**
155 	        If true, the player can behave normally. If false, the player cannot perform any action. 
156 	        */
157 	        protected
158 	         Boolean Send =
159 	       	
160 	        		null
161 	        	;
162 	
163 	        
164 	        
165  		/**
166          * If true, the player can behave normally. If false, the player cannot perform any action. 
167          */
168         public Boolean isSend()
169  	
170 	        {
171 	            return
172 	        	 Send;
173 	        }
174 	        
175 	        
176 	        
177  		
178  		/**
179          * If true, the player can behave normally. If false, the player cannot perform any action. 
180          */
181         public SetSendKeys 
182         setSend(Boolean Send)
183  	
184 			{
185 				this.Send = Send;
186 				return this;
187 			}
188 		
189  	    public String toString() {
190             return toMessage();
191         }
192  	
193  		public String toHtmlString() {
194 			return super.toString() + "[<br/>" +
195             	
196             	"<b>PlayerId</b> = " +
197             	String.valueOf(getPlayerId()
198  	) +
199             	" <br/> " +
200             	
201             	"<b>Player</b> = " +
202             	String.valueOf(getPlayer()
203  	) +
204             	" <br/> " +
205             	
206             	"<b>Send</b> = " +
207             	String.valueOf(isSend()
208  	) +
209             	" <br/> " +
210             	 
211             	"<br/>]"
212             ;
213 		}
214  	
215 		public String toMessage() {
216      		StringBuffer buf = new StringBuffer();
217      		buf.append("SETSENDKEYS");
218      		
219 						if (PlayerId != null) {
220 							buf.append(" {PlayerId " + PlayerId.getStringId() + "}");
221 						}
222 					
223 						if (Player != null) {
224 							buf.append(" {Player " + Player + "}");
225 						}
226 					
227 						if (Send != null) {
228 							buf.append(" {Send " + Send + "}");
229 						}
230 					
231    			return buf.toString();
232    		}
233  	
234  		// --- Extra Java from XML BEGIN (extra/code/java)
235         	
236 		// --- Extra Java from XML END (extra/code/java)
237  	
238 	        }
239