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 Will change map to MapName - map must exist on server (won't be
35 tested), will send MAPCHANGE message. When map change occurs all
36 connections to the server will be shutted down.
37
38 Corresponding GameBots command is
39 CHANGEMAP.
40
41 */
42
43 public class
44 ChangeMap extends
45 CommandMessage
46
47 {
48
49 /**
50 Creates new instance of command ChangeMap.
51
52 Will change map to MapName - map must exist on server (won't be
53 tested), will send MAPCHANGE message. When map change occurs all
54 connections to the server will be shutted down.
55 Corresponding GameBots message for this command is
56 CHANGEMAP.
57 @param MapName Name of the new map.
58 @param NotifyGame
59 If set to True game object will be notified about map change, otherwise it will not and map will be changed immediately. Setting this to false
60 will for example skip showing the stats in deathmatch game.
61
62 */
63 public ChangeMap(
64 String MapName, boolean NotifyGame) {
65
66 this.MapName = MapName;
67
68 this.NotifyGame = NotifyGame;
69
70 }
71
72
73 /**
74 Creates new instance of command ChangeMap.
75
76 Will change map to MapName - map must exist on server (won't be
77 tested), will send MAPCHANGE message. When map change occurs all
78 connections to the server will be shutted down.
79 Corresponding GameBots message for this command is
80 CHANGEMAP.
81 <p></p>WARNING: this is empty-command constructor, you have to use setters to fill it up!
82 */
83 public ChangeMap() {
84 }
85
86
87 /////// Properties BEGIN
88
89 /**
90 Name of the new map. */
91 protected
92 String MapName =
93 null;
94
95
96 /**
97 Name of the new map. */
98 public
99 String getMapName() {
100 return
101 MapName;
102 }
103
104
105
106 /**
107 Name of the new map. */
108 public ChangeMap setMapName(String MapName) {
109 this.MapName = MapName;
110 return this;
111 }
112
113 /**
114
115 If set to True game object will be notified about map change, otherwise it will not and map will be changed immediately. Setting this to false
116 will for example skip showing the stats in deathmatch game.
117 */
118 protected
119 boolean NotifyGame =
120 false;
121
122
123 /**
124
125 If set to True game object will be notified about map change, otherwise it will not and map will be changed immediately. Setting this to false
126 will for example skip showing the stats in deathmatch game.
127 */
128 public
129 boolean isNotifyGame() {
130 return
131 NotifyGame;
132 }
133
134
135
136 /**
137
138 If set to True game object will be notified about map change, otherwise it will not and map will be changed immediately. Setting this to false
139 will for example skip showing the stats in deathmatch game.
140 */
141 public ChangeMap setNotifyGame(boolean NotifyGame) {
142 this.NotifyGame = NotifyGame;
143 return this;
144 }
145
146 /////// Properties END
147
148 /////// Extra Java code BEGIN
149
150 /////// Additional code from xslt BEGIN
151
152
153
154 /////// Additional code from xslt END
155
156 /////// Extra Java from XML BEGIN
157
158 /////// Extra Java from XML END
159
160 /////// Extra Java code END
161
162
163
164 /**
165 * Cloning constructor.
166 */
167 public ChangeMap(ChangeMap original) {
168
169 this.MapName=original.MapName;
170
171 this.NotifyGame=original.NotifyGame;
172
173 }
174
175
176
177
178 public String toString() {
179 return
180
181 toMessage();
182
183 }
184
185 public String toHtmlString() {
186 return super.toString() +
187
188 "<b>MapName</b> : " +
189 String.valueOf(MapName) +
190 " <br/> " +
191
192 "<b>NotifyGame</b> : " +
193 String.valueOf(NotifyGame) +
194 " <br/> " +
195 "";
196 }
197
198
199
200 public String toMessage() {
201 StringBuffer buf = new StringBuffer();
202 buf.append("CHANGEMAP");
203
204 if (MapName != null) {
205 buf.append(" {MapName " + MapName + "}");
206 }
207
208 buf.append(" {NotifyGame " + NotifyGame + "}");
209
210 return buf.toString();
211 }
212
213 }
214
215