author | glx |
Mon, 26 May 2008 17:40:33 +0000 | |
branch | noai |
changeset 10718 | 7e9d9e40e16f |
parent 10715 | 6bdf79ffb022 |
permissions | -rw-r--r-- |
9723 | 1 |
/* $Id$ */ |
2 |
||
3 |
/** @file command_type.h Types related to commands. */ |
|
4 |
||
5 |
#ifndef COMMAND_TYPE_H |
|
6 |
#define COMMAND_TYPE_H |
|
7 |
||
8 |
#include "economy_type.h" |
|
9 |
#include "strings_type.h" |
|
10 |
#include "tile_type.h" |
|
11 |
||
12 |
/** |
|
13 |
* Common return value for all commands. Wraps the cost and |
|
14 |
* a possible error message/state together. |
|
15 |
*/ |
|
16 |
class CommandCost { |
|
17 |
ExpensesType expense_type; ///< the type of expence as shown on the finances view |
|
18 |
Money cost; ///< The cost of this action |
|
19 |
StringID message; ///< Warning message for when success is unset |
|
20 |
bool success; ///< Whether the comment went fine up to this moment |
|
21 |
||
22 |
public: |
|
23 |
/** |
|
24 |
* Creates a command cost return with no cost and no error |
|
25 |
*/ |
|
26 |
CommandCost() : expense_type(INVALID_EXPENSES), cost(0), message(INVALID_STRING_ID), success(true) {} |
|
27 |
||
28 |
/** |
|
29 |
* Creates a command return value the is failed with the given message |
|
30 |
*/ |
|
31 |
CommandCost(StringID msg) : expense_type(INVALID_EXPENSES), cost(0), message(msg), success(false) {} |
|
32 |
||
33 |
/** |
|
34 |
* Creates a command cost with given expense type and start cost of 0 |
|
35 |
* @param ex_t the expense type |
|
36 |
*/ |
|
37 |
CommandCost(ExpensesType ex_t) : expense_type(ex_t), cost(0), message(INVALID_STRING_ID), success(true) {} |
|
38 |
||
39 |
/** |
|
40 |
* Creates a command return value with the given start cost and expense type |
|
41 |
* @param ex_t the expense type |
|
42 |
* @param cst the initial cost of this command |
|
43 |
*/ |
|
44 |
CommandCost(ExpensesType ex_t, Money cst) : expense_type(ex_t), cost(cst), message(INVALID_STRING_ID), success(true) {} |
|
45 |
||
46 |
/** |
|
47 |
* Adds the cost of the given command return value to this cost. |
|
48 |
* Also takes a possible error message when it is set. |
|
49 |
* @param ret the command to add the cost of. |
|
50 |
* @return this class. |
|
51 |
*/ |
|
10142
56ee7da4ad56
(svn r12673) [NoAI] -Sync: with trunk r12596:12672. Note that due to the order rewrite AIOrder.ChangeOrder does currently not work as expected.
rubidium
parents:
9869
diff
changeset
|
52 |
CommandCost AddCost(CommandCost ret); |
9723 | 53 |
|
54 |
/** |
|
55 |
* Adds the given cost to the cost of the command. |
|
56 |
* @param cost the cost to add |
|
57 |
* @return this class. |
|
58 |
*/ |
|
9869
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
59 |
CommandCost AddCost(Money cost) |
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
60 |
{ |
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
61 |
this->cost += cost; |
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
62 |
return *this; |
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
63 |
} |
9723 | 64 |
|
65 |
/** |
|
66 |
* Multiplies the cost of the command by the given factor. |
|
67 |
* @param cost factor to multiply the costs with |
|
68 |
* @return this class |
|
69 |
*/ |
|
9869
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
70 |
CommandCost MultiplyCost(int factor) |
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
71 |
{ |
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
72 |
this->cost *= factor; |
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
73 |
return *this; |
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
74 |
} |
9723 | 75 |
|
76 |
/** |
|
77 |
* The costs as made up to this moment |
|
78 |
* @return the costs |
|
79 |
*/ |
|
9869
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
80 |
Money GetCost() const |
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
81 |
{ |
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
82 |
return this->cost; |
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
83 |
} |
9723 | 84 |
|
85 |
/** |
|
86 |
* The expense type of the cost |
|
87 |
* @return the expense type |
|
88 |
*/ |
|
9869
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
89 |
ExpensesType GetExpensesType() const |
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
90 |
{ |
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
91 |
return this->expense_type; |
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
92 |
} |
9723 | 93 |
|
94 |
/** |
|
95 |
* Sets the global error message *if* this class has one. |
|
96 |
*/ |
|
9869
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
97 |
void SetGlobalErrorMessage() const |
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
98 |
{ |
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
99 |
extern StringID _error_message; |
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
100 |
if (this->message != INVALID_STRING_ID) _error_message = this->message; |
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
101 |
} |
9723 | 102 |
|
103 |
/** |
|
104 |
* Did this command succeed? |
|
105 |
* @return true if and only if it succeeded |
|
106 |
*/ |
|
9869
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
107 |
bool Succeeded() const |
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
108 |
{ |
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
109 |
return this->success; |
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
110 |
} |
9723 | 111 |
|
112 |
/** |
|
113 |
* Did this command fail? |
|
114 |
* @return true if and only if it failed |
|
115 |
*/ |
|
9869
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
116 |
bool Failed() const |
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
117 |
{ |
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
118 |
return !this->success; |
6404afe43575
(svn r12597) [NoAI] -Sync: with trunk r12501:12596.
rubidium
parents:
9732
diff
changeset
|
119 |
} |
9723 | 120 |
}; |
121 |
||
122 |
/** |
|
123 |
* List of commands. |
|
124 |
* |
|
125 |
* This enum defines all possible commands which can be executed to the game |
|
126 |
* engine. Observing the game like the query-tool or checking the profit of a |
|
127 |
* vehicle don't result in a command which should be executed in the engine |
|
128 |
* nor send to the server in a network game. |
|
129 |
* |
|
130 |
* @see _command_proc_table |
|
131 |
*/ |
|
132 |
enum { |
|
9732 | 133 |
CMD_BUILD_RAILROAD_TRACK, ///< build a rail track |
134 |
CMD_REMOVE_RAILROAD_TRACK, ///< remove a rail track |
|
135 |
CMD_BUILD_SINGLE_RAIL, ///< build a single rail track |
|
136 |
CMD_REMOVE_SINGLE_RAIL, ///< remove a single rail track |
|
137 |
CMD_LANDSCAPE_CLEAR, ///< demolish a tile |
|
138 |
CMD_BUILD_BRIDGE, ///< build a bridge |
|
139 |
CMD_BUILD_RAILROAD_STATION, ///< build a railroad station |
|
140 |
CMD_BUILD_TRAIN_DEPOT, ///< build a train depot |
|
141 |
CMD_BUILD_SIGNALS, ///< build a signal |
|
142 |
CMD_REMOVE_SIGNALS, ///< remove a signal |
|
143 |
CMD_TERRAFORM_LAND, ///< terraform a tile |
|
144 |
CMD_PURCHASE_LAND_AREA, ///< purchase a tile |
|
145 |
CMD_SELL_LAND_AREA, ///< sell a bought tile before |
|
146 |
CMD_BUILD_TUNNEL, ///< build a tunnel |
|
9723 | 147 |
|
9732 | 148 |
CMD_REMOVE_FROM_RAILROAD_STATION, ///< remove a tile station |
149 |
CMD_CONVERT_RAIL, ///< convert a rail type |
|
9723 | 150 |
|
9732 | 151 |
CMD_BUILD_TRAIN_WAYPOINT, ///< build a waypoint |
152 |
CMD_RENAME_WAYPOINT, ///< rename a waypoint |
|
153 |
CMD_REMOVE_TRAIN_WAYPOINT, ///< remove a waypoint |
|
9723 | 154 |
|
9732 | 155 |
CMD_BUILD_ROAD_STOP, ///< build a road stop |
156 |
CMD_REMOVE_ROAD_STOP, ///< remove a road stop |
|
157 |
CMD_BUILD_LONG_ROAD, ///< build a complete road (not a "half" one) |
|
158 |
CMD_REMOVE_LONG_ROAD, ///< remove a complete road (not a "half" one) |
|
159 |
CMD_BUILD_ROAD, ///< build a "half" road |
|
160 |
CMD_REMOVE_ROAD, ///< remove a "half" road |
|
161 |
CMD_BUILD_ROAD_DEPOT, ///< build a road depot |
|
9723 | 162 |
|
9732 | 163 |
CMD_BUILD_AIRPORT, ///< build an airport |
9723 | 164 |
|
9732 | 165 |
CMD_BUILD_DOCK, ///< build a dock |
166 |
||
167 |
CMD_BUILD_SHIP_DEPOT, ///< build a ship depot |
|
168 |
CMD_BUILD_BUOY, ///< build a buoy |
|
169 |
||
170 |
CMD_PLANT_TREE, ///< plant a tree |
|
171 |
||
172 |
CMD_BUILD_RAIL_VEHICLE, ///< build a rail vehicle |
|
173 |
CMD_MOVE_RAIL_VEHICLE, ///< move a rail vehicle (in the depot) |
|
174 |
||
175 |
CMD_START_STOP_TRAIN, ///< start or stop a train |
|
176 |
||
177 |
CMD_SELL_RAIL_WAGON, ///< sell a rail wagon |
|
178 |
||
179 |
CMD_SEND_TRAIN_TO_DEPOT, ///< send a train to a depot |
|
180 |
CMD_FORCE_TRAIN_PROCEED, ///< proceed a train to pass a red signal |
|
181 |
CMD_REVERSE_TRAIN_DIRECTION, ///< turn a train around |
|
182 |
||
183 |
CMD_MODIFY_ORDER, ///< modify an order (like set full-load) |
|
184 |
CMD_SKIP_TO_ORDER, ///< skip an order to the next of specific one |
|
185 |
CMD_DELETE_ORDER, ///< delete an order |
|
186 |
CMD_INSERT_ORDER, ///< insert a new order |
|
187 |
||
188 |
CMD_CHANGE_SERVICE_INT, ///< change the server interval of a vehicle |
|
189 |
||
190 |
CMD_BUILD_INDUSTRY, ///< build a new industry |
|
191 |
||
192 |
CMD_BUILD_COMPANY_HQ, ///< build the company headquarter |
|
193 |
CMD_SET_PLAYER_FACE, ///< set the face of the player/company |
|
194 |
CMD_SET_PLAYER_COLOR, ///< set the color of the player/company |
|
195 |
||
196 |
CMD_INCREASE_LOAN, ///< increase the loan from the bank |
|
197 |
CMD_DECREASE_LOAN, ///< decrease the loan from the bank |
|
198 |
||
199 |
CMD_WANT_ENGINE_PREVIEW, ///< confirm the preview of an engine |
|
200 |
||
201 |
CMD_NAME_VEHICLE, ///< rename a whole vehicle |
|
202 |
CMD_RENAME_ENGINE, ///< rename a engine (in the engine list) |
|
203 |
CMD_CHANGE_COMPANY_NAME, ///< change the company name |
|
204 |
CMD_CHANGE_PRESIDENT_NAME, ///< change the president name |
|
205 |
CMD_RENAME_STATION, ///< rename a station |
|
206 |
||
207 |
CMD_SELL_AIRCRAFT, ///< sell an aircraft |
|
208 |
CMD_START_STOP_AIRCRAFT, ///< start/stop an aircraft |
|
209 |
CMD_BUILD_AIRCRAFT, ///< build an aircraft |
|
210 |
CMD_SEND_AIRCRAFT_TO_HANGAR, ///< send an aircraft to a hanger |
|
211 |
CMD_REFIT_AIRCRAFT, ///< refit the cargo space of an aircraft |
|
212 |
||
213 |
CMD_PLACE_SIGN, ///< place a sign |
|
214 |
CMD_RENAME_SIGN, ///< rename a sign |
|
215 |
||
216 |
CMD_BUILD_ROAD_VEH, ///< build a road vehicle |
|
217 |
CMD_START_STOP_ROADVEH, ///< start/stop a road vehicle |
|
218 |
CMD_SELL_ROAD_VEH, ///< sell a road vehicle |
|
219 |
CMD_SEND_ROADVEH_TO_DEPOT, ///< send a road vehicle to the depot |
|
220 |
CMD_TURN_ROADVEH, ///< turn a road vehicle around |
|
221 |
CMD_REFIT_ROAD_VEH, ///< refit the cargo space of a road vehicle |
|
222 |
||
223 |
CMD_PAUSE, ///< pause the game |
|
224 |
||
225 |
CMD_BUY_SHARE_IN_COMPANY, ///< buy a share from a company |
|
226 |
CMD_SELL_SHARE_IN_COMPANY, ///< sell a share from a company |
|
227 |
CMD_BUY_COMPANY, ///< buy a company which is bankrupt |
|
228 |
||
229 |
CMD_BUILD_TOWN, ///< build a town |
|
230 |
||
231 |
CMD_RENAME_TOWN, ///< rename a town |
|
232 |
CMD_DO_TOWN_ACTION, ///< do a action from the town detail window (like advertises or bribe) |
|
233 |
||
234 |
CMD_SET_ROAD_DRIVE_SIDE, ///< set the side where the road vehicles drive |
|
235 |
||
236 |
CMD_START_STOP_SHIP, ///< start/stop a ship |
|
237 |
CMD_SELL_SHIP, ///< sell a ship |
|
238 |
CMD_BUILD_SHIP, ///< build a new ship |
|
239 |
CMD_SEND_SHIP_TO_DEPOT, ///< send a ship to a depot |
|
240 |
CMD_REFIT_SHIP, ///< refit the cargo space of a ship |
|
241 |
||
242 |
CMD_ORDER_REFIT, ///< change the refit informaction of an order (for "goto depot" ) |
|
243 |
CMD_CLONE_ORDER, ///< clone (and share) an order |
|
244 |
CMD_CLEAR_AREA, ///< clear an area |
|
245 |
||
246 |
CMD_MONEY_CHEAT, ///< do the money cheat |
|
247 |
CMD_BUILD_CANAL, ///< build a canal |
|
248 |
||
249 |
CMD_PLAYER_CTRL, ///< used in multiplayer to create a new player etc. |
|
250 |
CMD_LEVEL_LAND, ///< level land |
|
251 |
||
252 |
CMD_REFIT_RAIL_VEHICLE, ///< refit the cargo space of a train |
|
253 |
CMD_RESTORE_ORDER_INDEX, ///< restore vehicle order-index and service interval |
|
254 |
CMD_BUILD_LOCK, ///< build a lock |
|
255 |
||
256 |
CMD_BUILD_SIGNAL_TRACK, ///< add signals along a track (by dragging) |
|
257 |
CMD_REMOVE_SIGNAL_TRACK, ///< remove signals along a track (by dragging) |
|
258 |
||
259 |
CMD_GIVE_MONEY, ///< give money to an other player |
|
260 |
CMD_CHANGE_PATCH_SETTING, ///< change a patch setting |
|
261 |
||
262 |
CMD_SET_AUTOREPLACE, ///< set an autoreplace entry |
|
263 |
||
264 |
CMD_CLONE_VEHICLE, ///< clone a vehicle |
|
265 |
CMD_MASS_START_STOP, ///< start/stop all vehicles (in a depot) |
|
266 |
CMD_DEPOT_SELL_ALL_VEHICLES, ///< sell all vehicles which are in a given depot |
|
267 |
CMD_DEPOT_MASS_AUTOREPLACE, ///< force the autoreplace to take action in a given depot |
|
268 |
||
269 |
CMD_CREATE_GROUP, ///< create a new group |
|
270 |
CMD_DELETE_GROUP, ///< delete a group |
|
271 |
CMD_RENAME_GROUP, ///< rename a group |
|
272 |
CMD_ADD_VEHICLE_GROUP, ///< add a vehicle to a group |
|
273 |
CMD_ADD_SHARED_VEHICLE_GROUP, ///< add all other shared vehicles to a group which are missing |
|
274 |
CMD_REMOVE_ALL_VEHICLES_GROUP, ///< remove all vehicles from a group |
|
275 |
CMD_SET_GROUP_REPLACE_PROTECTION, ///< set the autoreplace-protection for a group |
|
276 |
||
277 |
CMD_MOVE_ORDER, ///< move an order |
|
278 |
CMD_CHANGE_TIMETABLE, ///< change the timetable for a vehicle |
|
279 |
CMD_SET_VEHICLE_ON_TIME, ///< set the vehicle on time feature (timetable) |
|
280 |
CMD_AUTOFILL_TIMETABLE, ///< autofill the timetable |
|
9723 | 281 |
}; |
282 |
||
283 |
/** |
|
284 |
* List of flags for a command. |
|
285 |
* |
|
286 |
* This enums defines some flags which can be used for the commands. |
|
287 |
*/ |
|
288 |
enum { |
|
289 |
DC_EXEC = 0x01, ///< execute the given command |
|
290 |
DC_AUTO = 0x02, ///< don't allow building on structures |
|
291 |
DC_QUERY_COST = 0x04, ///< query cost only, don't build. |
|
292 |
DC_NO_WATER = 0x08, ///< don't allow building on water |
|
293 |
DC_NO_RAIL_OVERLAP = 0x10, ///< don't allow overlap of rails (used in buildrail) |
|
294 |
DC_AI_BUILDING = 0x20, ///< special building rules for AI |
|
295 |
DC_NO_TOWN_RATING = 0x40, ///< town rating does not disallow you from building |
|
9732 | 296 |
DC_BANKRUPT = 0x80, ///< company bankrupts, skip money check, skip vehicle on tile check in some cases |
9723 | 297 |
}; |
298 |
||
299 |
/** |
|
300 |
* Used to combine a StringID with the command. |
|
301 |
* |
|
302 |
* This macro can be used to add a StringID (the error message to show) on a command-id |
|
303 |
* (CMD_xxx). Use the binary or-operator "|" to combine the command with the result from |
|
304 |
* this macro. |
|
305 |
* |
|
306 |
* @param x The StringID to combine with a command-id |
|
307 |
*/ |
|
308 |
#define CMD_MSG(x) ((x) << 16) |
|
309 |
||
310 |
/** |
|
311 |
* Defines some flags. |
|
312 |
* |
|
313 |
* This enumeration defines some flags which are binary-or'ed on a command. |
|
314 |
*/ |
|
315 |
enum { |
|
316 |
CMD_NO_WATER = 0x0400, ///< dont build on water |
|
317 |
CMD_NETWORK_COMMAND = 0x0800, ///< execute the command without sending it on the network |
|
318 |
CMD_NO_TEST_IF_IN_NETWORK = 0x1000, ///< When enabled, the command will bypass the no-DC_EXEC round if in network |
|
319 |
CMD_SHOW_NO_ERROR = 0x2000, ///< do not show the error message |
|
320 |
}; |
|
321 |
||
322 |
/** |
|
323 |
* Command flags for the command table _command_proc_table. |
|
324 |
* |
|
325 |
* This enumeration defines flags for the _command_proc_table. |
|
326 |
*/ |
|
327 |
enum { |
|
328 |
CMD_SERVER = 0x1, ///< the command can only be initiated by the server |
|
329 |
CMD_OFFLINE = 0x2, ///< the command cannot be executed in a multiplayer game; single-player only |
|
330 |
CMD_AUTO = 0x4, ///< set the DC_AUTO flag on this command |
|
331 |
}; |
|
332 |
||
333 |
/** |
|
334 |
* Defines the callback type for all command handler functions. |
|
335 |
* |
|
336 |
* This type defines the function header for all functions which handles a CMD_* command. |
|
337 |
* A command handler use the parameters to act according to the meaning of the command. |
|
338 |
* The tile parameter defines the tile to perform an action on. |
|
339 |
* The flag parameter is filled with flags from the DC_* enumeration. The parameters |
|
340 |
* p1 and p2 are filled with parameters for the command like "which road type", "which |
|
341 |
* order" or "direction". Each function should mentioned in there doxygen comments |
|
342 |
* the usage of these parameters. |
|
343 |
* |
|
344 |
* @param tile The tile to apply a command on |
|
345 |
* @param flags Flags for the command, from the DC_* enumeration |
|
346 |
* @param p1 Additional data for the command |
|
347 |
* @param p2 Additional data for the command |
|
348 |
* @return The CommandCost of the command, which can be succeeded or failed. |
|
349 |
*/ |
|
350 |
typedef CommandCost CommandProc(TileIndex tile, uint32 flags, uint32 p1, uint32 p2); |
|
351 |
||
352 |
/** |
|
353 |
* Define a command with the flags which belongs to it. |
|
354 |
* |
|
355 |
* This struct connect a command handler function with the flags created with |
|
356 |
* the #CMD_AUTO, #CMD_OFFLINE and #CMD_SERVER values. |
|
357 |
*/ |
|
358 |
struct Command { |
|
359 |
CommandProc *proc; |
|
360 |
byte flags; |
|
361 |
}; |
|
362 |
||
363 |
/** |
|
364 |
* Define a callback function for the client, after the command is finished. |
|
365 |
* |
|
366 |
* Functions of this type are called after the command is finished. The parameters |
|
367 |
* are from the #CommandProc callback type. The boolean parameter indicates if the |
|
368 |
* command succeeded or failed. |
|
369 |
* |
|
370 |
* @param success If the command succeeded or not. |
|
371 |
* @param tile The tile of the command action |
|
372 |
* @param p1 Additional data of the command |
|
373 |
* @param p1 Additional data of the command |
|
374 |
* @see CommandProc |
|
375 |
*/ |
|
376 |
typedef void CommandCallback(bool success, TileIndex tile, uint32 p1, uint32 p2); |
|
377 |
||
378 |
#endif /* COMMAND_TYPE_H */ |