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 THESE FILES INSTEAD OF THIS ONE.
7   
8               IMPORTANT END !!!
9               */
10              package
11              cz.cuni.amis.pogamut.udk.communication.messages.gbcommands;
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  		Gives inventory from one bot to another. Bot can give just owned
35  		items. (in his inventory chain). He can't give weapon he is
36  		wielding right now. This command is not fully tested yet and has
37  		issues.
38  	
39                            Corresponding GameBots command is
40                            GIVEINV.
41                        
42               */
43              
44              public class
45              GiveInventory extends
46          CommandMessage
47  
48              {
49              
50              /**
51                Creates new instance of command GiveInventory.
52                
53  		Gives inventory from one bot to another. Bot can give just owned
54  		items. (in his inventory chain). He can't give weapon he is
55  		wielding right now. This command is not fully tested yet and has
56  		issues.
57  	Corresponding GameBots message for this command is
58                GIVEINV.
59                    @param Target Id of the receiving bot.
60                    @param ItemId 
61  			Id of the item in the inventory chain of the giver.
62  		
63                */
64               public GiveInventory(
65                  UnrealId Target,  String ItemId) {
66                      
67                      this.Target = Target;
68                  
69                      this.ItemId = ItemId;
70                  
71                  }
72  
73              
74              		/**
75  		             Creates new instance of command GiveInventory.
76  		             
77  		Gives inventory from one bot to another. Bot can give just owned
78  		items. (in his inventory chain). He can't give weapon he is
79  		wielding right now. This command is not fully tested yet and has
80  		issues.
81  	Corresponding GameBots message for this command is
82  		             GIVEINV.
83  		             <p></p>WARNING: this is empty-command constructor, you have to use setters to fill it up!
84  		             */
85              		public  GiveInventory() {
86              		}
87              	
88  
89              /////// Properties BEGIN
90              
91          /**
92          Id of the receiving bot. */
93          protected
94           UnrealId Target =
95          	null;
96  
97          
98          /**
99          Id of the receiving bot. */
100         public
101         UnrealId getTarget() {
102             return
103          Target;
104         }
105         
106 
107         
108             /**
109         Id of the receiving bot. */
110         public GiveInventory setTarget(UnrealId Target) {
111             this.Target = Target;
112             return this;
113             }
114        
115         /**
116         
117 			Id of the item in the inventory chain of the giver.
118 		 */
119         protected
120          String ItemId =
121         	null;
122 
123         
124         /**
125         
126 			Id of the item in the inventory chain of the giver.
127 		 */
128         public
129         String getItemId() {
130             return
131          ItemId;
132         }
133         
134 
135         
136             /**
137         
138 			Id of the item in the inventory chain of the giver.
139 		 */
140         public GiveInventory setItemId(String ItemId) {
141             this.ItemId = ItemId;
142             return this;
143             }
144        
145             /////// Properties END
146 
147             /////// Extra Java code BEGIN
148 
149             	/////// Additional code from xslt BEGIN
150             		
151 
152 
153             	/////// Additional code from xslt END
154 
155 	            /////// Extra Java from XML BEGIN
156             		
157             	/////// Extra Java from XML END
158 
159             /////// Extra Java code END
160 
161             
162 
163             /**
164               * Cloning constructor.
165               */
166              public GiveInventory(GiveInventory original) {
167                 
168                      this.Target=original.Target;
169                 
170                      this.ItemId=original.ItemId;
171                 
172              }
173 
174              
175 
176                  
177             public String toString() {
178                 return
179                 
180                     	toMessage();
181                     
182              }
183 
184              public String toHtmlString() {
185                 return super.toString() +
186             
187             "<b>Target</b> : " +
188             String.valueOf(Target) +
189             " <br/> " +
190             
191             "<b>ItemId</b> : " +
192             String.valueOf(ItemId) +
193             " <br/> " +
194              "";
195              }
196 
197              
198              
199              	 public String toMessage() {
200               		StringBuffer buf = new StringBuffer();
201               		buf.append("GIVEINV");
202               		
203 		    					if (Target != null) {
204 		    						buf.append(" {Target " + Target.getStringId() + "}");
205 		    					}
206 		    				
207 		    					if (ItemId != null) {
208 		    						buf.append(" {ItemId " + ItemId + "}");
209 		    					}
210 		    				
211             		return buf.toString();
212             }
213              
214              }
215 
216