OpenTTD

command_type.h
Go to the documentation of this file.
1 /* $Id: command_type.h 26802 2014-09-07 16:12:58Z alberth $ */
2
3 /*
4 * This file is part of OpenTTD.
5 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 */
9
12 #ifndef COMMAND_TYPE_H
13 #define COMMAND_TYPE_H
14
15 #include "economy_type.h"
16 #include "strings_type.h"
17 #include "tile_type.h"
18
19 struct GRFFile;
20
25 class CommandCost {
26 ExpensesType expense_type;
27 Money cost;
28 StringID message;
29 bool success;
30 const GRFFile *textref_stack_grffile;
31 uint textref_stack_size;
32
33 static uint32 textref_stack[16];
34
35 public:
39 CommandCost() : expense_type(INVALID_EXPENSES), cost(0), message(INVALID_STRING_ID), success(true), textref_stack_grffile(NULL), textref_stack_size(0) {}
40
44 explicit CommandCost(StringID msg) : expense_type(INVALID_EXPENSES), cost(0), message(msg), success(false), textref_stack_grffile(NULL), textref_stack_size(0) {}
45
50 explicit CommandCost(ExpensesType ex_t) : expense_type(ex_t), cost(0), message(INVALID_STRING_ID), success(true), textref_stack_grffile(NULL), textref_stack_size(0) {}
51
57 CommandCost(ExpensesType ex_t, const Money &cst) : expense_type(ex_t), cost(cst), message(INVALID_STRING_ID), success(true), textref_stack_grffile(NULL), textref_stack_size(0) {}
58
59
64 inline void AddCost(const Money &cost)
65 {
66 this->cost += cost;
67 }
68
69 void AddCost(const CommandCost &cmd_cost);
70
75 inline void MultiplyCost(int factor)
76 {
77 this->cost *= factor;
78 }
79
84 inline Money GetCost() const
85 {
86 return this->cost;
87 }
88
93 inline ExpensesType GetExpensesType() const
94 {
95 return this->expense_type;
96 }
97
102 void MakeError(StringID message)
103 {
104 assert(message != INVALID_STRING_ID);
105 this->success = false;
106 this->message = message;
107 }
108
109 void UseTextRefStack(const GRFFile *grffile, uint num_registers);
110
115 const GRFFile *GetTextRefStackGRF() const
116 {
117 return this->textref_stack_grffile;
118 }
119
124 uint GetTextRefStackSize() const
125 {
126 return this->textref_stack_size;
127 }
128
133 const uint32 *GetTextRefStack() const
134 {
135 return textref_stack;
136 }
137
142 StringID GetErrorMessage() const
143 {
144 if (this->success) return INVALID_STRING_ID;
145 return this->message;
146 }
147
152 inline bool Succeeded() const
153 {
154 return this->success;
155 }
156
161 inline bool Failed() const
162 {
163 return !this->success;
164 }
165 };
166
177 enum Commands {
178 CMD_BUILD_RAILROAD_TRACK,
179 CMD_REMOVE_RAILROAD_TRACK,
180 CMD_BUILD_SINGLE_RAIL,
181 CMD_REMOVE_SINGLE_RAIL,
182 CMD_LANDSCAPE_CLEAR,
183 CMD_BUILD_BRIDGE,
184 CMD_BUILD_RAIL_STATION,
185 CMD_BUILD_TRAIN_DEPOT,
186 CMD_BUILD_SIGNALS,
187 CMD_REMOVE_SIGNALS,
188 CMD_TERRAFORM_LAND,
189 CMD_BUILD_OBJECT,
190 CMD_BUILD_TUNNEL,
191
192 CMD_REMOVE_FROM_RAIL_STATION,
193 CMD_CONVERT_RAIL,
194
195 CMD_BUILD_RAIL_WAYPOINT,
196 CMD_RENAME_WAYPOINT,
197 CMD_REMOVE_FROM_RAIL_WAYPOINT,
198
199 CMD_BUILD_ROAD_STOP,
200 CMD_REMOVE_ROAD_STOP,
201 CMD_BUILD_LONG_ROAD,
202 CMD_REMOVE_LONG_ROAD,
203 CMD_BUILD_ROAD,
204 CMD_BUILD_ROAD_DEPOT,
205
206 CMD_BUILD_AIRPORT,
207
208 CMD_BUILD_DOCK,
209
210 CMD_BUILD_SHIP_DEPOT,
211 CMD_BUILD_BUOY,
212
213 CMD_PLANT_TREE,
214
215 CMD_BUILD_VEHICLE,
216 CMD_SELL_VEHICLE,
217 CMD_REFIT_VEHICLE,
218 CMD_SEND_VEHICLE_TO_DEPOT,
219 CMD_SET_VEHICLE_VISIBILITY,
220
221 CMD_MOVE_RAIL_VEHICLE,
222 CMD_FORCE_TRAIN_PROCEED,
223 CMD_REVERSE_TRAIN_DIRECTION,
224
225 CMD_CLEAR_ORDER_BACKUP,
226 CMD_MODIFY_ORDER,
227 CMD_SKIP_TO_ORDER,
228 CMD_DELETE_ORDER,
229 CMD_INSERT_ORDER,
230
231 CMD_CHANGE_SERVICE_INT,
232
233 CMD_BUILD_INDUSTRY,
234
235 CMD_SET_COMPANY_MANAGER_FACE,
236 CMD_SET_COMPANY_COLOUR,
237
238 CMD_INCREASE_LOAN,
239 CMD_DECREASE_LOAN,
240
241 CMD_WANT_ENGINE_PREVIEW,
242
243 CMD_RENAME_VEHICLE,
244 CMD_RENAME_ENGINE,
245 CMD_RENAME_COMPANY,
246 CMD_RENAME_PRESIDENT,
247 CMD_RENAME_STATION,
248 CMD_RENAME_DEPOT,
249
250 CMD_PLACE_SIGN,
251 CMD_RENAME_SIGN,
252
253 CMD_TURN_ROADVEH,
254
255 CMD_PAUSE,
256
257 CMD_BUY_SHARE_IN_COMPANY,
258 CMD_SELL_SHARE_IN_COMPANY,
259 CMD_BUY_COMPANY,
260
261 CMD_FOUND_TOWN,
262 CMD_RENAME_TOWN,
263 CMD_DO_TOWN_ACTION,
264 CMD_TOWN_CARGO_GOAL,
265 CMD_TOWN_GROWTH_RATE,
266 CMD_TOWN_SET_TEXT,
267 CMD_EXPAND_TOWN,
268 CMD_DELETE_TOWN,
269
270 CMD_ORDER_REFIT,
271 CMD_CLONE_ORDER,
272 CMD_CLEAR_AREA,
273
274 CMD_MONEY_CHEAT,
275 CMD_CHANGE_BANK_BALANCE,
276 CMD_BUILD_CANAL,
277
278 CMD_CREATE_SUBSIDY,
279 CMD_COMPANY_CTRL,
280 CMD_CUSTOM_NEWS_ITEM,
281 CMD_CREATE_GOAL,
282 CMD_REMOVE_GOAL,
283 CMD_SET_GOAL_TEXT,
284 CMD_SET_GOAL_PROGRESS,
285 CMD_SET_GOAL_COMPLETED,
286 CMD_GOAL_QUESTION,
287 CMD_GOAL_QUESTION_ANSWER,
288 CMD_CREATE_STORY_PAGE,
289 CMD_CREATE_STORY_PAGE_ELEMENT,
290 CMD_UPDATE_STORY_PAGE_ELEMENT,
291 CMD_SET_STORY_PAGE_TITLE,
292 CMD_SET_STORY_PAGE_DATE,
293 CMD_SHOW_STORY_PAGE,
294 CMD_REMOVE_STORY_PAGE,
295 CMD_REMOVE_STORY_PAGE_ELEMENT,
296 CMD_LEVEL_LAND,
297
298 CMD_BUILD_LOCK,
299
300 CMD_BUILD_SIGNAL_TRACK,
301 CMD_REMOVE_SIGNAL_TRACK,
302
303 CMD_GIVE_MONEY,
304 CMD_CHANGE_SETTING,
305 CMD_CHANGE_COMPANY_SETTING,
306
307 CMD_SET_AUTOREPLACE,
308
309 CMD_CLONE_VEHICLE,
310 CMD_START_STOP_VEHICLE,
311 CMD_MASS_START_STOP,
312 CMD_AUTOREPLACE_VEHICLE,
313 CMD_DEPOT_SELL_ALL_VEHICLES,
314 CMD_DEPOT_MASS_AUTOREPLACE,
315
316 CMD_CREATE_GROUP,
317 CMD_DELETE_GROUP,
318 CMD_ALTER_GROUP,
319 CMD_ADD_VEHICLE_GROUP,
320 CMD_ADD_SHARED_VEHICLE_GROUP,
321 CMD_REMOVE_ALL_VEHICLES_GROUP,
322 CMD_SET_GROUP_REPLACE_PROTECTION,
323
324 CMD_MOVE_ORDER,
325 CMD_CHANGE_TIMETABLE,
326 CMD_SET_VEHICLE_ON_TIME,
327 CMD_AUTOFILL_TIMETABLE,
328 CMD_SET_TIMETABLE_START,
329
330 CMD_OPEN_CLOSE_AIRPORT,
331
332 CMD_END,
333 };
334
340 enum DoCommandFlag {
341 DC_NONE = 0x000,
342 DC_EXEC = 0x001,
343 DC_AUTO = 0x002,
344 DC_QUERY_COST = 0x004,
345 DC_NO_WATER = 0x008,
346 DC_NO_RAIL_OVERLAP = 0x010,
347 DC_NO_TEST_TOWN_RATING = 0x020,
348 DC_BANKRUPT = 0x040,
349 DC_AUTOREPLACE = 0x080,
350 DC_NO_CARGO_CAP_CHECK = 0x100,
351 DC_ALL_TILES = 0x200,
352 DC_NO_MODIFY_TOWN_RATING = 0x400,
353 DC_FORCE_CLEAR_TILE = 0x800,
354 };
355 DECLARE_ENUM_AS_BIT_SET(DoCommandFlag)
356
357
366 #define CMD_MSG(x) ((x) << 16)
367
373 enum FlaggedCommands {
374 CMD_NETWORK_COMMAND = 0x0100,
375 CMD_FLAGS_MASK = 0xFF00,
376 CMD_ID_MASK = 0x00FF,
377 };
378
384 enum CommandFlags {
385 CMD_SERVER = 0x001,
386 CMD_SPECTATOR = 0x002,
387 CMD_OFFLINE = 0x004,
388 CMD_AUTO = 0x008,
389 CMD_ALL_TILES = 0x010,
390 CMD_NO_TEST = 0x020,
391 CMD_NO_WATER = 0x040,
392 CMD_CLIENT_ID = 0x080,
393 CMD_DEITY = 0x100,
394 CMD_STR_CTRL = 0x200,
395 };
396 DECLARE_ENUM_AS_BIT_SET(CommandFlags)
397
398
399 enum CommandType {
400 CMDT_LANDSCAPE_CONSTRUCTION,
401 CMDT_VEHICLE_CONSTRUCTION,
402 CMDT_MONEY_MANAGEMENT,
403 CMDT_VEHICLE_MANAGEMENT,
404 CMDT_ROUTE_MANAGEMENT,
405 CMDT_OTHER_MANAGEMENT,
406 CMDT_COMPANY_SETTING,
407 CMDT_SERVER_SETTING,
408 CMDT_CHEAT,
409
410 CMDT_END,
411 };
412
414 enum CommandPauseLevel {
415 CMDPL_NO_ACTIONS,
416 CMDPL_NO_CONSTRUCTION,
417 CMDPL_NO_LANDSCAPING,
418 CMDPL_ALL_ACTIONS,
419 };
420
439 typedef CommandCost CommandProc(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text);
440
447 struct Command {
448 CommandProc *proc;
449 const char *name;
450 CommandFlags flags;
451 CommandType type;
452 };
453
467 typedef void CommandCallback(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2);
468
472 struct CommandContainer {
473 TileIndex tile;
474 uint32 p1;
475 uint32 p2;
476 uint32 cmd;
477 CommandCallback *callback;
478 char text[32 * MAX_CHAR_LENGTH];
479 };
480
481 #endif /* COMMAND_TYPE_H */
CommandType
CommandType
Types of commands we have.
Definition: command_type.h:399
CMD_CLEAR_ORDER_BACKUP
clear the order backup of a given user/tile
Definition: command_type.h:225
DC_AUTO
don&#39;t allow building on structures
Definition: command_type.h:343
DC_NO_MODIFY_TOWN_RATING
do not change town rating
Definition: command_type.h:352
CMD_CHANGE_TIMETABLE
change the timetable for a vehicle
Definition: command_type.h:325
DECLARE_ENUM_AS_BIT_SET
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
Definition: company_manager_face.h:31
CMD_RENAME_DEPOT
rename a depot
Definition: command_type.h:248
CMD_COMPANY_CTRL
used in multiplayer to create a new companies etc.
Definition: command_type.h:279
CMD_NO_WATER
set the DC_NO_WATER flag on this command
Definition: command_type.h:391
CMD_BUILD_RAIL_WAYPOINT
build a waypoint
Definition: command_type.h:195
DC_FORCE_CLEAR_TILE
do not only remove the object on the tile, but also clear any water left on it
Definition: command_type.h:353
CMDPL_NO_LANDSCAPING
No landscaping actions may be executed.
Definition: command_type.h:417
CMD_RENAME_SIGN
rename a sign
Definition: command_type.h:251
CMD_BUILD_DOCK
build a dock
Definition: command_type.h:208
CMD_RENAME_TOWN
rename a town
Definition: command_type.h:262
CMD_OPEN_CLOSE_AIRPORT
open/close an airport to incoming aircraft
Definition: command_type.h:330
CMD_SET_VEHICLE_ON_TIME
set the vehicle on time feature (timetable)
Definition: command_type.h:326
CMD_RENAME_VEHICLE
rename a whole vehicle
Definition: command_type.h:243
CMD_BUILD_LONG_ROAD
build a complete road (not a "half" one)
Definition: command_type.h:201
CMD_CREATE_GOAL
create a new goal
Definition: command_type.h:281
CMD_CLIENT_ID
set p2 with the ClientID of the sending client.
Definition: command_type.h:392
CMD_REMOVE_LONG_ROAD
remove a complete road (not a "half" one)
Definition: command_type.h:202
CMD_PLANT_TREE
plant a tree
Definition: command_type.h:213
CommandCost::textref_stack
static uint32 textref_stack[16]
Values to put on the TextRefStack for the error message.
Definition: command_type.h:33
CMD_REMOVE_SIGNAL_TRACK
remove signals along a track (by dragging)
Definition: command_type.h:301
CMD_CHANGE_BANK_BALANCE
change bank balance to charge costs or give money from a GS
Definition: command_type.h:275
CMD_CHANGE_SERVICE_INT
change the server interval of a vehicle
Definition: command_type.h:231
CMD_TERRAFORM_LAND
terraform a tile
Definition: command_type.h:188
CommandCost::GetExpensesType
ExpensesType GetExpensesType() const
The expense type of the cost.
Definition: command_type.h:93
DC_QUERY_COST
query cost only, don&#39;t build.
Definition: command_type.h:344
Command::type
CommandType type
The type of command.
Definition: command_type.h:451
CMD_AUTO
set the DC_AUTO flag on this command
Definition: command_type.h:388
DC_NONE
no flag is set
Definition: command_type.h:341
CommandContainer::p2
uint32 p2
parameter p2.
Definition: command_type.h:475
CMD_AUTOFILL_TIMETABLE
autofill the timetable
Definition: command_type.h:327
CMD_CHANGE_COMPANY_SETTING
change a company setting
Definition: command_type.h:305
CommandFlags
CommandFlags
Command flags for the command table _command_proc_table.
Definition: command_type.h:384
CMD_BUY_COMPANY
buy a company which is bankrupt
Definition: command_type.h:259
CMD_BUILD_SIGNAL_TRACK
add signals along a track (by dragging)
Definition: command_type.h:300
CMDPL_ALL_ACTIONS
All actions may be executed.
Definition: command_type.h:418
CMD_LANDSCAPE_CLEAR
demolish a tile
Definition: command_type.h:182
CommandCost::CommandCost
CommandCost(StringID msg)
Creates a command return value the is failed with the given message.
Definition: command_type.h:44
CommandCost::UseTextRefStack
void UseTextRefStack(const GRFFile *grffile, uint num_registers)
Activate usage of the NewGRF TextRefStack for the error message.
Definition: command.cpp:795
CMD_SET_STORY_PAGE_TITLE
update title of a story page
Definition: command_type.h:291
CMD_BUILD_ROAD
build a "half" road
Definition: command_type.h:203
CMD_BUILD_RAIL_STATION
build a rail station
Definition: command_type.h:184
CMD_DO_TOWN_ACTION
do a action from the town detail window (like advertises or bribe)
Definition: command_type.h:263
Command
Define a command with the flags which belongs to it.
Definition: command_type.h:447
Command::name
const char * name
A human readable name for the procedure.
Definition: command_type.h:449
CMD_CLONE_ORDER
clone (and share) an order
Definition: command_type.h:271
CommandCost::GetCost
Money GetCost() const
The costs as made up to this moment.
Definition: command_type.h:84
CMD_SET_STORY_PAGE_DATE
update date of a story page
Definition: command_type.h:292
CommandCost
Common return value for all commands.
Definition: command_type.h:25
CMD_TOWN_SET_TEXT
set the custom text of a town
Definition: command_type.h:266
CommandCost::MultiplyCost
void MultiplyCost(int factor)
Multiplies the cost of the command by the given factor.
Definition: command_type.h:75
CommandCost::AddCost
void AddCost(const Money &cost)
Adds the given cost to the cost of the command.
Definition: command_type.h:64
CommandCost::MakeError
void MakeError(StringID message)
Makes this CommandCost behave like an error command.
Definition: command_type.h:102
CMD_SKIP_TO_ORDER
skip an order to the next of specific one
Definition: command_type.h:227
CommandCost::GetTextRefStackGRF
const GRFFile * GetTextRefStackGRF() const
Returns the NewGRF providing the TextRefStack of the error message.
Definition: command_type.h:115
CMD_DELETE_GROUP
delete a group
Definition: command_type.h:317
DC_NO_CARGO_CAP_CHECK
when autoreplace/autorenew is in progress, this shall prevent truncating the amount of cargo in the v...
Definition: command_type.h:350
CMD_BUILD_AIRPORT
build an airport
Definition: command_type.h:206
CMD_AUTOREPLACE_VEHICLE
replace/renew a vehicle while it is in a depot
Definition: command_type.h:312
DC_BANKRUPT
company bankrupts, skip money check, skip vehicle on tile check in some cases
Definition: command_type.h:348
CMD_START_STOP_VEHICLE
start or stop a vehicle
Definition: command_type.h:310
CMD_ALTER_GROUP
alter a group
Definition: command_type.h:318
CMDT_SERVER_SETTING
Pausing/removing companies/server settings.
Definition: command_type.h:407
CMD_BUILD_SINGLE_RAIL
build a single rail track
Definition: command_type.h:180
CMD_SET_VEHICLE_VISIBILITY
hide or unhide a vehicle in the build vehicle and autoreplace GUIs
Definition: command_type.h:219
CMD_FORCE_TRAIN_PROCEED
proceed a train to pass a red signal
Definition: command_type.h:222
CMD_ADD_SHARED_VEHICLE_GROUP
add all other shared vehicles to a group which are missing
Definition: command_type.h:320
MAX_CHAR_LENGTH
static const int MAX_CHAR_LENGTH
Max. length of UTF-8 encoded unicode character.
Definition: strings_type.h:20
CMD_DECREASE_LOAN
decrease the loan from the bank
Definition: command_type.h:239
CommandPauseLevel
CommandPauseLevel
Different command pause levels.
Definition: command_type.h:414
CMD_REMOVE_ALL_VEHICLES_GROUP
remove all vehicles from a group
Definition: command_type.h:321
CMD_FLAGS_MASK
mask for all command flags
Definition: command_type.h:375
CMD_TOWN_GROWTH_RATE
set the town growth rate
Definition: command_type.h:265
CMD_CUSTOM_NEWS_ITEM
create a custom news message
Definition: command_type.h:280
economy_type.h
Types related to the economy.
CMDT_CHEAT
A cheat of some sorts.
Definition: command_type.h:408
CMD_REMOVE_STORY_PAGE_ELEMENT
remove a story page element
Definition: command_type.h:295
CMD_NETWORK_COMMAND
execute the command without sending it on the network
Definition: command_type.h:374
CMD_FOUND_TOWN
found a town
Definition: command_type.h:261
CMD_ID_MASK
mask for the command ID
Definition: command_type.h:376
CMD_INCREASE_LOAN
increase the loan from the bank
Definition: command_type.h:238
CommandContainer::p1
uint32 p1
parameter p1.
Definition: command_type.h:474
CMD_REFIT_VEHICLE
refit the cargo space of a vehicle
Definition: command_type.h:217
CMD_REMOVE_GOAL
remove a goal
Definition: command_type.h:282
CommandCost::GetErrorMessage
StringID GetErrorMessage() const
Returns the error message of a command.
Definition: command_type.h:142
CMDT_VEHICLE_CONSTRUCTION
Construction, modification (incl. refit) and destruction of vehicles.
Definition: command_type.h:401
CommandContainer
Structure for buffering the build command when selecting a station to join.
Definition: command_type.h:472
DoCommandFlag
DoCommandFlag
List of flags for a command.
Definition: command_type.h:340
CMD_BUILD_TUNNEL
build a tunnel
Definition: command_type.h:190
CommandCost::Succeeded
bool Succeeded() const
Did this command succeed?
Definition: command_type.h:152
CMD_DEITY
the command may be executed by COMPANY_DEITY
Definition: command_type.h:393
CMD_BUILD_VEHICLE
build a vehicle
Definition: command_type.h:215
CommandCost::textref_stack_grffile
const GRFFile * textref_stack_grffile
NewGRF providing the TextRefStack content.
Definition: command_type.h:30
CMD_REMOVE_STORY_PAGE
remove a story page
Definition: command_type.h:294
CommandCost::CommandCost
CommandCost(ExpensesType ex_t, const Money &cst)
Creates a command return value with the given start cost and expense type.
Definition: command_type.h:57
CommandCost::expense_type
ExpensesType expense_type
the type of expence as shown on the finances view
Definition: command_type.h:26
CMD_SET_COMPANY_MANAGER_FACE
set the manager&#39;s face of the company
Definition: command_type.h:235
CMD_INSERT_ORDER
insert a new order
Definition: command_type.h:229
CMD_NO_TEST
the command&#39;s output may differ between test and execute due to town rating changes etc...
Definition: command_type.h:390
CMD_DELETE_TOWN
delete a town
Definition: command_type.h:268
CMD_SET_TIMETABLE_START
set the date that a timetable should start
Definition: command_type.h:328
CMD_SHOW_STORY_PAGE
show a story page
Definition: command_type.h:293
CommandCost::message
StringID message
Warning message for when success is unset.
Definition: command_type.h:28
CMD_EXPAND_TOWN
expand a town
Definition: command_type.h:267
CommandCost::GetTextRefStack
const uint32 * GetTextRefStack() const
Returns a pointer to the values for the TextRefStack of the error message.
Definition: command_type.h:133
CMD_RENAME_COMPANY
change the company name
Definition: command_type.h:245
DC_NO_WATER
don&#39;t allow building on water
Definition: command_type.h:345
CMD_SET_COMPANY_COLOUR
set the colour of the company
Definition: command_type.h:236
CommandCost::CommandCost
CommandCost(ExpensesType ex_t)
Creates a command cost with given expense type and start cost of 0.
Definition: command_type.h:50
CommandCost::textref_stack_size
uint textref_stack_size
Number of uint32 values to put on the TextRefStack for the error message.
Definition: command_type.h:31
ExpensesType
ExpensesType
Types of expenses.
Definition: economy_type.h:150
CMDT_OTHER_MANAGEMENT
Renaming stuff, changing company colours, placing signs, etc.
Definition: command_type.h:405
CMD_TOWN_CARGO_GOAL
set the goal of a cargo for a town
Definition: command_type.h:264
CMD_PLACE_SIGN
place a sign
Definition: command_type.h:250
CMD_GIVE_MONEY
give money to another company
Definition: command_type.h:303
CMDT_LANDSCAPE_CONSTRUCTION
Construction and destruction of objects on the map.
Definition: command_type.h:400
CMD_MONEY_CHEAT
do the money cheat
Definition: command_type.h:274
CMD_SERVER
the command can only be initiated by the server
Definition: command_type.h:385
CMD_BUILD_ROAD_DEPOT
build a road depot
Definition: command_type.h:204
StringID
uint32 StringID
Numeric value that represents a string, independent of the selected language.
Definition: strings_type.h:18
CMD_STR_CTRL
the command&#39;s string may contain control strings
Definition: command_type.h:394
CommandCost::Failed
bool Failed() const
Did this command fail?
Definition: command_type.h:161
CMD_RENAME_WAYPOINT
rename a waypoint
Definition: command_type.h:196
CMDT_END
Magic end marker.
Definition: command_type.h:410
CMD_UPDATE_STORY_PAGE_ELEMENT
update a story page element
Definition: command_type.h:290
CMD_BUILD_SIGNALS
build a signal
Definition: command_type.h:186
CMD_DEPOT_MASS_AUTOREPLACE
force the autoreplace to take action in a given depot
Definition: command_type.h:314
CMDPL_NO_CONSTRUCTION
No construction actions may be executed.
Definition: command_type.h:416
CMD_SPECTATOR
the command may be initiated by a spectator
Definition: command_type.h:386
DC_ALL_TILES
allow this command also on MP_VOID tiles
Definition: command_type.h:351
DC_AUTOREPLACE
autoreplace/autorenew is in progress, this shall disable vehicle limits when building, and ignore certain restrictions when undoing things (like vehicle attach callback)
Definition: command_type.h:349
CommandContainer::callback
CommandCallback * callback
any callback function executed upon successful completion of the command.
Definition: command_type.h:477
CMD_CREATE_STORY_PAGE
create a new story page
Definition: command_type.h:288
CMD_CONVERT_RAIL
convert a rail type
Definition: command_type.h:193
CMDT_MONEY_MANAGEMENT
Management of money, i.e. loans and shares.
Definition: command_type.h:402
CMD_SET_GOAL_PROGRESS
update goal progress text of a goal
Definition: command_type.h:284
CMD_WANT_ENGINE_PREVIEW
confirm the preview of an engine
Definition: command_type.h:241
CMD_CHANGE_SETTING
change a setting
Definition: command_type.h:304
DC_EXEC
execute the given command
Definition: command_type.h:342
CommandCost::GetTextRefStackSize
uint GetTextRefStackSize() const
Returns the number of uint32 values for the TextRefStack of the error message.
Definition: command_type.h:124
CMD_BUILD_ROAD_STOP
build a road stop
Definition: command_type.h:199
CMD_ADD_VEHICLE_GROUP
add a vehicle to a group
Definition: command_type.h:319
CMD_SELL_VEHICLE
sell a vehicle
Definition: command_type.h:216
Command::proc
CommandProc * proc
The procedure to actually executing.
Definition: command_type.h:448
CMD_END
Must ALWAYS be on the end of this list!! (period)
Definition: command_type.h:332
TileIndex
uint32 TileIndex
The index/ID of a Tile.
Definition: tile_type.h:80
Command::flags
CommandFlags flags
The (command) flags to that apply to this command.
Definition: command_type.h:450
CMDT_ROUTE_MANAGEMENT
Modifications to route management (orders, groups, etc).
Definition: command_type.h:404
CMD_SELL_SHARE_IN_COMPANY
sell a share from a company
Definition: command_type.h:258
CMD_CREATE_STORY_PAGE_ELEMENT
create a new story page element
Definition: command_type.h:289
CMD_REVERSE_TRAIN_DIRECTION
turn a train around
Definition: command_type.h:223
CMD_RENAME_PRESIDENT
change the president name
Definition: command_type.h:246
FlaggedCommands
FlaggedCommands
Defines some flags.
Definition: command_type.h:373
CMD_ORDER_REFIT
change the refit information of an order (for "goto depot" )
Definition: command_type.h:270
CMD_BUILD_CANAL
build a canal
Definition: command_type.h:276
CMD_GOAL_QUESTION
ask a goal related question
Definition: command_type.h:286
CommandProc
CommandCost CommandProc(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Defines the callback type for all command handler functions.
Definition: command_type.h:439
CMD_CLEAR_AREA
clear an area
Definition: command_type.h:272
CMD_CREATE_GROUP
create a new group
Definition: command_type.h:316
CMD_DEPOT_SELL_ALL_VEHICLES
sell all vehicles which are in a given depot
Definition: command_type.h:313
CMDT_VEHICLE_MANAGEMENT
Stopping, starting, sending to depot, turning around, replace orders etc.
Definition: command_type.h:403
CMD_REMOVE_SINGLE_RAIL
remove a single rail track
Definition: command_type.h:181
CMD_SET_GROUP_REPLACE_PROTECTION
set the autoreplace-protection for a group
Definition: command_type.h:322
CMD_CLONE_VEHICLE
clone a vehicle
Definition: command_type.h:309
CMD_BUILD_BUOY
build a buoy
Definition: command_type.h:211
CMD_RENAME_ENGINE
rename a engine (in the engine list)
Definition: command_type.h:244
CommandContainer::tile
TileIndex tile
tile command being executed on.
Definition: command_type.h:473
CMD_BUILD_TRAIN_DEPOT
build a train depot
Definition: command_type.h:185
CMD_RENAME_STATION
rename a station
Definition: command_type.h:247
CMD_MASS_START_STOP
start/stop all vehicles (in a depot)
Definition: command_type.h:311
CMD_CREATE_SUBSIDY
create a new subsidy
Definition: command_type.h:278
strings_type.h
Types related to strings.
CMD_BUILD_BRIDGE
build a bridge
Definition: command_type.h:183
CommandCost::success
bool success
Whether the comment went fine up to this moment.
Definition: command_type.h:29
INVALID_STRING_ID
static const StringID INVALID_STRING_ID
Constant representing an invalid string (16bit in case it is used in savegames)
Definition: strings_type.h:19
CommandCallback
void CommandCallback(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2)
Define a callback function for the client, after the command is finished.
Definition: command_type.h:467
CMD_OFFLINE
the command cannot be executed in a multiplayer game; single-player only
Definition: command_type.h:387
Commands
Commands
List of commands.
Definition: command_type.h:177
CMD_REMOVE_SIGNALS
remove a signal
Definition: command_type.h:187
DC_NO_RAIL_OVERLAP
don&#39;t allow overlap of rails (used in buildrail)
Definition: command_type.h:346
CMD_REMOVE_FROM_RAIL_STATION
remove a (rectangle of) tiles from a rail station
Definition: command_type.h:192
CMDT_COMPANY_SETTING
Changing settings related to a company.
Definition: command_type.h:406
CMD_SET_GOAL_TEXT
update goal text of a goal
Definition: command_type.h:283
CMD_REMOVE_RAILROAD_TRACK
remove a rail track
Definition: command_type.h:179
CMD_GOAL_QUESTION_ANSWER
answer(s) to CMD_GOAL_QUESTION
Definition: command_type.h:287
CMD_SEND_VEHICLE_TO_DEPOT
send a vehicle to a depot
Definition: command_type.h:218
INVALID_EXPENSES
Invalid expense type.
Definition: economy_type.h:165
CMD_BUY_SHARE_IN_COMPANY
buy a share from a company
Definition: command_type.h:257
CMDPL_NO_ACTIONS
No user actions may be executed.
Definition: command_type.h:415
CMD_BUILD_SHIP_DEPOT
build a ship depot
Definition: command_type.h:210
CommandCost::CommandCost
CommandCost()
Creates a command cost return with no cost and no error.
Definition: command_type.h:39
tile_type.h
Types related to tiles.
DC_NO_TEST_TOWN_RATING
town rating does not disallow you from building
Definition: command_type.h:347
CMD_MOVE_RAIL_VEHICLE
move a rail vehicle (in the depot)
Definition: command_type.h:221
CMD_SET_AUTOREPLACE
set an autoreplace entry
Definition: command_type.h:307
CMD_MOVE_ORDER
move an order
Definition: command_type.h:324
CommandCost::cost
Money cost
The cost of this action.
Definition: command_type.h:27
CMD_REMOVE_FROM_RAIL_WAYPOINT
remove a (rectangle of) tiles from a rail waypoint
Definition: command_type.h:197
CommandContainer::cmd
uint32 cmd
command being executed.
Definition: command_type.h:476
CMD_REMOVE_ROAD_STOP
remove a road stop
Definition: command_type.h:200
CMD_LEVEL_LAND
level land
Definition: command_type.h:296
CMD_MODIFY_ORDER
modify an order (like set full-load)
Definition: command_type.h:226
OverflowSafeInt< int64, INT64_MAX, INT64_MIN >
CMD_ALL_TILES
allow this command also on MP_VOID tiles
Definition: command_type.h:389
CMD_BUILD_INDUSTRY
build a new industry
Definition: command_type.h:233
CMD_TURN_ROADVEH
turn a road vehicle around
Definition: command_type.h:253
CMD_SET_GOAL_COMPLETED
update goal completed status of a goal
Definition: command_type.h:285
CMD_DELETE_ORDER
delete an order
Definition: command_type.h:228
CMD_BUILD_LOCK
build a lock
Definition: command_type.h:298
CMD_BUILD_OBJECT
build an object
Definition: command_type.h:189
CMD_BUILD_RAILROAD_TRACK
build a rail track
Definition: command_type.h:178
GRFFile
Dynamic data of a loaded NewGRF.
Definition: newgrf.h:104
CMD_PAUSE
pause the game
Definition: command_type.h:255