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