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 PICK.
15   		 *
16   		 * 
17  		When automatic pickup is disabled for bot (in ini bDisableAutoPickup=true) or if set by CONF {AutoPickupOff True},
18  		use this command to pickup inventory the bot is currently at. Will fail if the bot can't
19  		pickup the item for some reason - weaponstay true and already had it before or etc.
20  	
21           */
22   	public class Pick 
23  		extends CommandMessage
24  	        {
25  	        	
26  		        
27      	/** Example how the message looks like - used during parser tests. */
28      	public static final String PROTOTYPE =
29      		" {Id unreal_id} ";
30      
31  		/**
32  		 * Creates new instance of command Pick.
33  		 * 
34  		When automatic pickup is disabled for bot (in ini bDisableAutoPickup=true) or if set by CONF {AutoPickupOff True},
35  		use this command to pickup inventory the bot is currently at. Will fail if the bot can't
36  		pickup the item for some reason - weaponstay true and already had it before or etc.
37  	
38  		 * Corresponding GameBots message for this command is
39  		 * PICK.
40  		 *
41  		 * 
42  		 *    @param Id 
43  			Id of the pickup we want to pick up.
44  		
45  		 */
46  		public Pick(
47  			UnrealId Id
48  		) {
49  			
50  				this.Id = Id;
51              
52  		}
53  
54  		
55  			/**
56  			 * Creates new instance of command Pick.
57  			 * 
58  		When automatic pickup is disabled for bot (in ini bDisableAutoPickup=true) or if set by CONF {AutoPickupOff True},
59  		use this command to pickup inventory the bot is currently at. Will fail if the bot can't
60  		pickup the item for some reason - weaponstay true and already had it before or etc.
61  	
62  			 * Corresponding GameBots message for this command is
63  			 * PICK.
64  			 * <p></p>
65  			 * WARNING: this is empty-command constructor, you have to use setters to fill it up with data that should be sent to GameBots2004!
66  		     */
67  		    public Pick() {
68  		    }
69  			
70  		
71  		/**
72  		 * Cloning constructor.
73  		 *
74  		 * @param original
75  		 */
76  		public Pick(Pick original) {
77  		   
78  		        this.Id = original.Id;
79  		   
80  		}
81      
82  	        /**
83  	        
84  			Id of the pickup we want to pick up.
85  		 
86  	        */
87  	        protected
88  	         UnrealId Id =
89  	       	
90  	        		null
91  	        	;
92  	
93  	        
94  	        
95   		/**
96           * 
97  			Id of the pickup we want to pick up.
98  		 
99           */
100         public UnrealId getId()
101  	
102 	        {
103 	            return
104 	        	 Id;
105 	        }
106 	        
107 	        
108 	        
109  		
110  		/**
111          * 
112 			Id of the pickup we want to pick up.
113 		 
114          */
115         public Pick 
116         setId(UnrealId Id)
117  	
118 			{
119 				this.Id = Id;
120 				return this;
121 			}
122 		
123  	    public String toString() {
124             return toMessage();
125         }
126  	
127  		public String toHtmlString() {
128 			return super.toString() + "[<br/>" +
129             	
130             	"<b>Id</b> = " +
131             	String.valueOf(getId()
132  	) +
133             	" <br/> " +
134             	 
135             	"<br/>]"
136             ;
137 		}
138  	
139 		public String toMessage() {
140      		StringBuffer buf = new StringBuffer();
141      		buf.append("PICK");
142      		
143 						if (Id != null) {
144 							buf.append(" {Id " + Id.getStringId() + "}");
145 						}
146 					
147    			return buf.toString();
148    		}
149  	
150  		// --- Extra Java from XML BEGIN (extra/code/java)
151         	
152 		// --- Extra Java from XML END (extra/code/java)
153  	
154 	        }
155