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  		Message you'll send at the beginning of the communication to
35  		start observing a player. You need to supply either name or ID
36          of the player to observe.
37          If you are already observing a player, you will stop observing that player
38          and start observing the player specified by this message.
39  	
40                            Corresponding GameBots command is
41                            INIT.
42                        
43               */
44              
45              public class
46              InitializeObserver extends
47          CommandMessage
48  
49              {
50              
51              /**
52                Creates new instance of command InitializeObserver.
53                
54  		Message you'll send at the beginning of the communication to
55  		start observing a player. You need to supply either name or ID
56          of the player to observe.
57          If you are already observing a player, you will stop observing that player
58          and start observing the player specified by this message.
59  	Corresponding GameBots message for this command is
60                INIT.
61                    @param Name Name of the player you wannt to observe.
62                    @param Id The ID of the player you want to observe.
63                */
64               public InitializeObserver(
65                  String Name,  String Id) {
66                      
67                      this.Name = Name;
68                  
69                      this.Id = Id;
70                  
71                  }
72  
73              
74              		/**
75  		             Creates new instance of command InitializeObserver.
76  		             
77  		Message you'll send at the beginning of the communication to
78  		start observing a player. You need to supply either name or ID
79          of the player to observe.
80          If you are already observing a player, you will stop observing that player
81          and start observing the player specified by this message.
82  	Corresponding GameBots message for this command is
83  		             INIT.
84  		             <p></p>WARNING: this is empty-command constructor, you have to use setters to fill it up!
85  		             */
86              		public  InitializeObserver() {
87              		}
88              	
89  
90              /////// Properties BEGIN
91              
92          /**
93          Name of the player you wannt to observe. */
94          protected
95           String Name =
96          	null;
97  
98          
99          /**
100         Name of the player you wannt to observe. */
101         public
102         String getName() {
103             return
104          Name;
105         }
106         
107 
108         
109             /**
110         Name of the player you wannt to observe. */
111         public InitializeObserver setName(String Name) {
112             this.Name = Name;
113             return this;
114             }
115        
116         /**
117         The ID of the player you want to observe. */
118         protected
119          String Id =
120         	null;
121 
122         
123         /**
124         The ID of the player you want to observe. */
125         public
126         String getId() {
127             return
128          Id;
129         }
130         
131 
132         
133             /**
134         The ID of the player you want to observe. */
135         public InitializeObserver setId(String Id) {
136             this.Id = Id;
137             return this;
138             }
139        
140             /////// Properties END
141 
142             /////// Extra Java code BEGIN
143 
144             	/////// Additional code from xslt BEGIN
145             		
146 
147 
148             	/////// Additional code from xslt END
149 
150 	            /////// Extra Java from XML BEGIN
151             		
152             	/////// Extra Java from XML END
153 
154             /////// Extra Java code END
155 
156             
157 
158             /**
159               * Cloning constructor.
160               */
161              public InitializeObserver(InitializeObserver original) {
162                 
163                      this.Name=original.Name;
164                 
165                      this.Id=original.Id;
166                 
167              }
168 
169              
170 
171                  
172             public String toString() {
173                 return
174                 
175                     	toMessage();
176                     
177              }
178 
179              public String toHtmlString() {
180                 return super.toString() +
181             
182             "<b>Name</b> : " +
183             String.valueOf(Name) +
184             " <br/> " +
185             
186             "<b>Id</b> : " +
187             String.valueOf(Id) +
188             " <br/> " +
189              "";
190              }
191 
192              
193              
194              	 public String toMessage() {
195               		StringBuffer buf = new StringBuffer();
196               		buf.append("INIT");
197               		
198 		    					if (Name != null) {
199 		    						buf.append(" {Name " + Name + "}");
200 		    					}
201 		    				
202 		    					if (Id != null) {
203 		    						buf.append(" {Id " + Id + "}");
204 		    					}
205 		    				
206             		return buf.toString();
207             }
208              
209              }
210 
211