OpenTTD Source  20241108-master-g80f628063a
command_type.h
Go to the documentation of this file.
1 /*
2  * This file is part of OpenTTD.
3  * 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.
4  * 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.
5  * 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/>.
6  */
7 
10 #ifndef COMMAND_TYPE_H
11 #define COMMAND_TYPE_H
12 
13 #include "economy_type.h"
14 #include "strings_type.h"
15 #include "tile_type.h"
16 
17 struct GRFFile;
18 
23 class CommandCost {
27  bool success;
31 
32  static uint32_t textref_stack[16];
33 
34 public:
39 
44 
50 
57 
58 
63  inline void AddCost(const Money &cost)
64  {
65  this->cost += cost;
66  }
67 
68  void AddCost(const CommandCost &cmd_cost);
69 
74  inline void MultiplyCost(int factor)
75  {
76  this->cost *= factor;
77  }
78 
83  inline Money GetCost() const
84  {
85  return this->cost;
86  }
87 
93  {
94  return this->expense_type;
95  }
96 
102  {
103  assert(message != INVALID_STRING_ID);
104  this->success = false;
105  this->message = message;
106  this->extra_message = extra_message;
107  }
108 
109  void UseTextRefStack(const GRFFile *grffile, uint num_registers);
110 
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_t *GetTextRefStack() const
134  {
135  return textref_stack;
136  }
137 
143  {
144  if (this->success) return INVALID_STRING_ID;
145  return this->message;
146  }
147 
153  {
154  if (this->success) return INVALID_STRING_ID;
155  return this->extra_message;
156  }
157 
162  inline bool Succeeded() const
163  {
164  return this->success;
165  }
166 
171  inline bool Failed() const
172  {
173  return !this->success;
174  }
175 };
176 
187 enum Commands : uint16_t {
202 
205 
209 
212 
220 
222 
224 
227 
229 
235 
239 
245 
247 
253 
256 
260 
263 
270 
273 
275 
277 
279 
290 
294 
298 
321 
323 
325 
328 
332 
334 
341 
350 
357 
359 
365 
367 };
368 
375  DC_NONE = 0x000,
376  DC_EXEC = 0x001,
377  DC_AUTO = 0x002,
378  DC_QUERY_COST = 0x004,
379  DC_NO_WATER = 0x008,
380  // 0x010 is unused
382  DC_BANKRUPT = 0x040,
383  DC_AUTOREPLACE = 0x080,
385  DC_ALL_TILES = 0x200,
388 };
390 
391 
397  CMD_SERVER = 0x001,
398  CMD_SPECTATOR = 0x002,
399  CMD_OFFLINE = 0x004,
400  CMD_AUTO = 0x008,
401  CMD_ALL_TILES = 0x010,
402  CMD_NO_TEST = 0x020,
403  CMD_NO_WATER = 0x040,
404  CMD_CLIENT_ID = 0x080,
405  CMD_DEITY = 0x100,
406  CMD_STR_CTRL = 0x200,
407  CMD_NO_EST = 0x400,
408  CMD_LOCATION = 0x800,
409 };
411 
412 
423 
425 };
426 
433 };
434 
435 
436 template <typename T> struct CommandFunctionTraitHelper;
437 template <typename... Targs>
439  using Args = std::tuple<std::decay_t<Targs>...>;
440  using RetTypes = void;
441  using CbArgs = Args;
442  using CbProcType = void(*)(Commands, const CommandCost &);
443 };
444 template <template <typename...> typename Tret, typename... Tretargs, typename... Targs>
445 struct CommandFunctionTraitHelper<Tret<CommandCost, Tretargs...>(*)(DoCommandFlag, Targs...)> {
446  using Args = std::tuple<std::decay_t<Targs>...>;
447  using RetTypes = std::tuple<std::decay_t<Tretargs>...>;
448  using CbArgs = std::tuple<std::decay_t<Tretargs>..., std::decay_t<Targs>...>;
449  using CbProcType = void(*)(Commands, const CommandCost &, Tretargs...);
450 };
451 
453 template <Commands Tcmd> struct CommandTraits;
454 
455 #define DEF_CMD_TRAIT(cmd_, proc_, flags_, type_) \
456  template<> struct CommandTraits<cmd_> { \
457  using ProcType = decltype(&proc_); \
458  using Args = typename CommandFunctionTraitHelper<ProcType>::Args; \
459  using RetTypes = typename CommandFunctionTraitHelper<ProcType>::RetTypes; \
460  using CbArgs = typename CommandFunctionTraitHelper<ProcType>::CbArgs; \
461  using RetCallbackProc = typename CommandFunctionTraitHelper<ProcType>::CbProcType; \
462  static constexpr Commands cmd = cmd_; \
463  static constexpr auto &proc = proc_; \
464  static constexpr CommandFlags flags = (CommandFlags)(flags_); \
465  static constexpr CommandType type = type_; \
466  static inline constexpr const char *name = #proc_; \
467  };
468 
470 typedef std::vector<uint8_t> CommandDataBuffer;
471 
484 typedef void CommandCallback(Commands cmd, const CommandCost &result, TileIndex tile);
485 
500 typedef void CommandCallbackData(Commands cmd, const CommandCost &result, const CommandDataBuffer &data, CommandDataBuffer result_data);
501 
502 #endif /* COMMAND_TYPE_H */
Common return value for all commands.
Definition: command_type.h:23
ExpensesType GetExpensesType() const
The expense type of the cost.
Definition: command_type.h:92
bool Succeeded() const
Did this command succeed?
Definition: command_type.h:162
void AddCost(const Money &cost)
Adds the given cost to the cost of the command.
Definition: command_type.h:63
uint GetTextRefStackSize() const
Returns the number of uint32_t values for the TextRefStack of the error message.
Definition: command_type.h:124
Money cost
The cost of this action.
Definition: command_type.h:25
StringID extra_message
Additional warning message for when success is unset.
Definition: command_type.h:30
CommandCost(ExpensesType ex_t, const Money &cst)
Creates a command return value with the given start cost and expense type.
Definition: command_type.h:56
Money GetCost() const
The costs as made up to this moment.
Definition: command_type.h:83
CommandCost(ExpensesType ex_t)
Creates a command cost with given expense type and start cost of 0.
Definition: command_type.h:49
uint textref_stack_size
Number of uint32_t values to put on the TextRefStack for the error message.
Definition: command_type.h:29
const GRFFile * GetTextRefStackGRF() const
Returns the NewGRF providing the TextRefStack of the error message.
Definition: command_type.h:115
CommandCost(StringID msg, StringID extra_msg=INVALID_STRING_ID)
Creates a command return value with one, or optionally two, error message strings.
Definition: command_type.h:43
void UseTextRefStack(const GRFFile *grffile, uint num_registers)
Activate usage of the NewGRF TextRefStack for the error message.
Definition: command.cpp:422
static uint32_t textref_stack[16]
Values to put on the TextRefStack for the error message.
Definition: command_type.h:32
StringID message
Warning message for when success is unset.
Definition: command_type.h:26
bool Failed() const
Did this command fail?
Definition: command_type.h:171
CommandCost()
Creates a command cost return with no cost and no error.
Definition: command_type.h:38
void MultiplyCost(int factor)
Multiplies the cost of the command by the given factor.
Definition: command_type.h:74
const GRFFile * textref_stack_grffile
NewGRF providing the TextRefStack content.
Definition: command_type.h:28
StringID GetErrorMessage() const
Returns the error message of a command.
Definition: command_type.h:142
const uint32_t * GetTextRefStack() const
Returns a pointer to the values for the TextRefStack of the error message.
Definition: command_type.h:133
bool success
Whether the command went fine up to this moment.
Definition: command_type.h:27
ExpensesType expense_type
the type of expence as shown on the finances view
Definition: command_type.h:24
StringID GetExtraErrorMessage() const
Returns the extra error message of a command.
Definition: command_type.h:152
void MakeError(StringID message, StringID extra_message=INVALID_STRING_ID)
Makes this CommandCost behave like an error command.
Definition: command_type.h:101
void CommandCallback(Commands cmd, const CommandCost &result, TileIndex tile)
Define a callback function for the client, after the command is finished.
Definition: command_type.h:484
CommandPauseLevel
Different command pause levels.
Definition: command_type.h:428
@ CMDPL_NO_LANDSCAPING
No landscaping actions may be executed.
Definition: command_type.h:431
@ CMDPL_ALL_ACTIONS
All actions may be executed.
Definition: command_type.h:432
@ CMDPL_NO_ACTIONS
No user actions may be executed.
Definition: command_type.h:429
@ CMDPL_NO_CONSTRUCTION
No construction actions may be executed.
Definition: command_type.h:430
CommandType
Types of commands we have.
Definition: command_type.h:413
@ CMDT_END
Magic end marker.
Definition: command_type.h:424
@ CMDT_VEHICLE_CONSTRUCTION
Construction, modification (incl. refit) and destruction of vehicles.
Definition: command_type.h:415
@ CMDT_COMPANY_SETTING
Changing settings related to a company.
Definition: command_type.h:420
@ CMDT_LANDSCAPE_CONSTRUCTION
Construction and destruction of objects on the map.
Definition: command_type.h:414
@ CMDT_VEHICLE_MANAGEMENT
Stopping, starting, sending to depot, turning around, replace orders etc.
Definition: command_type.h:417
@ CMDT_CHEAT
A cheat of some sorts.
Definition: command_type.h:422
@ CMDT_ROUTE_MANAGEMENT
Modifications to route management (orders, groups, etc).
Definition: command_type.h:418
@ CMDT_OTHER_MANAGEMENT
Renaming stuff, changing company colours, placing signs, etc.
Definition: command_type.h:419
@ CMDT_MONEY_MANAGEMENT
Management of money, i.e. loans.
Definition: command_type.h:416
@ CMDT_SERVER_SETTING
Pausing/removing companies/server settings.
Definition: command_type.h:421
DoCommandFlag
List of flags for a command.
Definition: command_type.h:374
@ DC_AUTOREPLACE
autoreplace/autorenew is in progress, this shall disable vehicle limits when building,...
Definition: command_type.h:383
@ DC_NONE
no flag is set
Definition: command_type.h:375
@ DC_NO_TEST_TOWN_RATING
town rating does not disallow you from building
Definition: command_type.h:381
@ DC_AUTO
don't allow building on structures
Definition: command_type.h:377
@ 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:384
@ 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:387
@ DC_NO_WATER
don't allow building on water
Definition: command_type.h:379
@ DC_NO_MODIFY_TOWN_RATING
do not change town rating
Definition: command_type.h:386
@ DC_ALL_TILES
allow this command also on MP_VOID tiles
Definition: command_type.h:385
@ DC_BANKRUPT
company bankrupts, skip money check, skip vehicle on tile check in some cases
Definition: command_type.h:382
@ DC_QUERY_COST
query cost only, don't build.
Definition: command_type.h:378
@ DC_EXEC
execute the given command
Definition: command_type.h:376
void CommandCallbackData(Commands cmd, const CommandCost &result, const CommandDataBuffer &data, CommandDataBuffer result_data)
Define a callback function for the client, after the command is finished.
Definition: command_type.h:500
std::vector< uint8_t > CommandDataBuffer
Storage buffer for serialized command data.
Definition: command_type.h:470
Commands
List of commands.
Definition: command_type.h:187
@ CMD_BUILD_LONG_ROAD
build a complete road (not a "half" one)
Definition: command_type.h:215
@ CMD_REMOVE_FROM_RAIL_WAYPOINT
remove a (rectangle of) tiles from a rail waypoint
Definition: command_type.h:208
@ CMD_REMOVE_STORY_PAGE
remove a story page
Definition: command_type.h:317
@ CMD_OPEN_CLOSE_AIRPORT
open/close an airport to incoming aircraft
Definition: command_type.h:358
@ CMD_WANT_ENGINE_PREVIEW
confirm the preview of an engine
Definition: command_type.h:261
@ CMD_GOAL_QUESTION_ANSWER
answer(s) to CMD_GOAL_QUESTION
Definition: command_type.h:310
@ CMD_CREATE_STORY_PAGE_ELEMENT
create a new story page element
Definition: command_type.h:312
@ CMD_BUILD_OBJECT_AREA
build an area of objects
Definition: command_type.h:200
@ CMD_BUILD_TRAIN_DEPOT
build a train depot
Definition: command_type.h:195
@ CMD_MASS_START_STOP
start/stop all vehicles (in a depot)
Definition: command_type.h:337
@ CMD_UPDATE_LEAGUE_TABLE_ELEMENT_DATA
update the data fields of a league table element
Definition: command_type.h:362
@ CMD_REMOVE_SINGLE_RAIL
remove a single rail track
Definition: command_type.h:191
@ CMD_PAUSE
pause the game
Definition: command_type.h:276
@ CMD_BUILD_ROAD
build a "half" road
Definition: command_type.h:217
@ CMD_BUILD_BUOY
build a buoy
Definition: command_type.h:226
@ CMD_SET_GOAL_DESTINATION
update goal destination of a goal
Definition: command_type.h:305
@ CMD_SHOW_STORY_PAGE
show a story page
Definition: command_type.h:316
@ CMD_MONEY_CHEAT
do the money cheat
Definition: command_type.h:295
@ CMD_EXPAND_TOWN
expand a town
Definition: command_type.h:287
@ CMD_COMPANY_CTRL
used in multiplayer to create a new companies etc.
Definition: command_type.h:300
@ CMD_CONVERT_RAIL
convert a rail type
Definition: command_type.h:204
@ CMD_MODIFY_ORDER
modify an order (like set full-load)
Definition: command_type.h:241
@ CMD_BUILD_SIGNAL_TRACK
add signals along a track (by dragging)
Definition: command_type.h:326
@ CMD_ADD_SHARED_VEHICLE_GROUP
add all other shared vehicles to a group which are missing
Definition: command_type.h:346
@ CMD_GOAL_QUESTION
ask a goal related question
Definition: command_type.h:309
@ CMD_UPDATE_STORY_PAGE_ELEMENT
update a story page element
Definition: command_type.h:313
@ CMD_MOVE_ORDER
move an order
Definition: command_type.h:351
@ CMD_SELL_VEHICLE
sell a vehicle
Definition: command_type.h:231
@ CMD_CLONE_VEHICLE
clone a vehicle
Definition: command_type.h:335
@ CMD_CREATE_STORY_PAGE
create a new story page
Definition: command_type.h:311
@ CMD_DELETE_TOWN
delete a town
Definition: command_type.h:288
@ CMD_SET_TIMETABLE_START
set the date that a timetable should start
Definition: command_type.h:356
@ CMD_CONVERT_ROAD
convert a road type
Definition: command_type.h:219
@ CMD_SET_VEHICLE_ON_TIME
set the vehicle on time feature (timetable)
Definition: command_type.h:354
@ CMD_BUILD_VEHICLE
build a vehicle
Definition: command_type.h:230
@ CMD_REMOVE_RAILROAD_TRACK
remove a rail track
Definition: command_type.h:189
@ CMD_TOWN_SET_TEXT
set the custom text of a town
Definition: command_type.h:286
@ CMD_BUILD_OBJECT
build an object
Definition: command_type.h:199
@ CMD_SET_AUTOREPLACE
set an autoreplace entry
Definition: command_type.h:333
@ CMD_REMOVE_LEAGUE_TABLE_ELEMENT
remove a league table element
Definition: command_type.h:364
@ CMD_CREATE_LEAGUE_TABLE_ELEMENT
create a new element in a league table
Definition: command_type.h:361
@ CMD_DEPOT_SELL_ALL_VEHICLES
sell all vehicles which are in a given depot
Definition: command_type.h:339
@ CMD_REMOVE_LONG_ROAD
remove a complete road (not a "half" one)
Definition: command_type.h:216
@ CMD_BUILD_SHIP_DEPOT
build a ship depot
Definition: command_type.h:225
@ CMD_RENAME_COMPANY
change the company name
Definition: command_type.h:266
@ CMD_BUILD_DOCK
build a dock
Definition: command_type.h:223
@ CMD_STORY_PAGE_BUTTON
selection via story page button
Definition: command_type.h:320
@ CMD_DECREASE_LOAN
decrease the loan from the bank
Definition: command_type.h:258
@ CMD_FOUND_TOWN
found a town
Definition: command_type.h:280
@ CMD_PLACE_SIGN
place a sign
Definition: command_type.h:271
@ CMD_REFIT_VEHICLE
refit the cargo space of a vehicle
Definition: command_type.h:232
@ CMD_LEVEL_LAND
level land
Definition: command_type.h:322
@ CMD_CREATE_GOAL
create a new goal
Definition: command_type.h:303
@ CMD_SET_COMPANY_MANAGER_FACE
set the manager's face of the company
Definition: command_type.h:254
@ CMD_LANDSCAPE_CLEAR
demolish a tile
Definition: command_type.h:192
@ CMD_INDUSTRY_SET_FLAGS
change industry control flags
Definition: command_type.h:249
@ CMD_TURN_ROADVEH
turn a road vehicle around
Definition: command_type.h:274
@ CMD_CLEAR_AREA
clear an area
Definition: command_type.h:293
@ CMD_ENGINE_CTRL
control availability of the engine for companies
Definition: command_type.h:262
@ CMD_INDUSTRY_SET_TEXT
change additional text for the industry
Definition: command_type.h:251
@ CMD_FORCE_TRAIN_PROCEED
proceed a train to pass a red signal
Definition: command_type.h:237
@ CMD_DO_TOWN_ACTION
do a action from the town detail window (like advertises or bribe)
Definition: command_type.h:282
@ CMD_SET_STORY_PAGE_TITLE
update title of a story page
Definition: command_type.h:314
@ CMD_ADD_VEHICLE_GROUP
add a vehicle to a group
Definition: command_type.h:345
@ CMD_BUILD_CANAL
build a canal
Definition: command_type.h:297
@ CMD_CLONE_ORDER
clone (and share) an order
Definition: command_type.h:292
@ CMD_BUILD_ROAD_WAYPOINT
build a road waypoint
Definition: command_type.h:210
@ CMD_REMOVE_FROM_ROAD_WAYPOINT
remove a (rectangle of) tiles from a road waypoint
Definition: command_type.h:211
@ CMD_SKIP_TO_ORDER
skip an order to the next of specific one
Definition: command_type.h:242
@ CMD_INDUSTRY_SET_EXCLUSIVITY
change industry exclusive consumer/supplier
Definition: command_type.h:250
@ CMD_INDUSTRY_SET_PRODUCTION
change industry production
Definition: command_type.h:252
@ CMD_REVERSE_TRAIN_DIRECTION
turn a train around
Definition: command_type.h:238
@ CMD_CREATE_SUBSIDY
create a new subsidy
Definition: command_type.h:299
@ CMD_RENAME_WAYPOINT
rename a waypoint
Definition: command_type.h:207
@ CMD_BUILD_RAIL_WAYPOINT
build a waypoint
Definition: command_type.h:206
@ CMD_DELETE_ORDER
delete an order
Definition: command_type.h:243
@ CMD_CHANGE_SETTING
change a setting
Definition: command_type.h:330
@ CMD_TOWN_RATING
set rating of a company in a town
Definition: command_type.h:285
@ CMD_END
Must ALWAYS be on the end of this list!! (period)
Definition: command_type.h:366
@ CMD_BUY_COMPANY
buy a company which is bankrupt
Definition: command_type.h:278
@ CMD_PLANT_TREE
plant a tree
Definition: command_type.h:228
@ CMD_ORDER_REFIT
change the refit information of an order (for "goto depot" )
Definition: command_type.h:291
@ CMD_CLEAR_ORDER_BACKUP
clear the order backup of a given user/tile
Definition: command_type.h:240
@ CMD_SET_GOAL_COMPLETED
update goal completed status of a goal
Definition: command_type.h:308
@ CMD_BUILD_AIRPORT
build an airport
Definition: command_type.h:221
@ CMD_TERRAFORM_LAND
terraform a tile
Definition: command_type.h:198
@ CMD_BUILD_BRIDGE
build a bridge
Definition: command_type.h:193
@ CMD_GIVE_MONEY
give money to another company
Definition: command_type.h:329
@ CMD_RENAME_VEHICLE
rename a whole vehicle
Definition: command_type.h:264
@ CMD_SET_STORY_PAGE_DATE
update date of a story page
Definition: command_type.h:315
@ CMD_RENAME_PRESIDENT
change the president name
Definition: command_type.h:267
@ CMD_BUILD_LOCK
build a lock
Definition: command_type.h:324
@ CMD_COMPANY_ALLOW_LIST_CTRL
Used in multiplayer to add/remove a client's public key to/from the company's allow list.
Definition: command_type.h:301
@ CMD_PLACE_HOUSE
place a house
Definition: command_type.h:289
@ CMD_CHANGE_TIMETABLE
change the timetable for a vehicle
Definition: command_type.h:352
@ CMD_DEPOT_MASS_AUTOREPLACE
force the autoreplace to take action in a given depot
Definition: command_type.h:340
@ CMD_CHANGE_COMPANY_SETTING
change a company setting
Definition: command_type.h:331
@ CMD_CUSTOM_NEWS_ITEM
create a custom news message
Definition: command_type.h:302
@ CMD_BUILD_RAILROAD_TRACK
build a rail track
Definition: command_type.h:188
@ CMD_CREATE_LEAGUE_TABLE
create a new league table
Definition: command_type.h:360
@ CMD_ALTER_GROUP
alter a group
Definition: command_type.h:344
@ CMD_RENAME_SIGN
rename a sign
Definition: command_type.h:272
@ CMD_INCREASE_LOAN
increase the loan from the bank
Definition: command_type.h:257
@ CMD_BUILD_ROAD_DEPOT
build a road depot
Definition: command_type.h:218
@ CMD_SCROLL_VIEWPORT
scroll main viewport of players
Definition: command_type.h:319
@ CMD_SET_COMPANY_MAX_LOAN
sets the max loan for the company
Definition: command_type.h:259
@ CMD_BUILD_INDUSTRY
build a new industry
Definition: command_type.h:248
@ CMD_SEND_VEHICLE_TO_DEPOT
send a vehicle to a depot
Definition: command_type.h:233
@ CMD_SET_VEHICLE_VISIBILITY
hide or unhide a vehicle in the build vehicle and autoreplace GUIs
Definition: command_type.h:234
@ CMD_SET_GROUP_FLAG
set/clear a flag for a group
Definition: command_type.h:348
@ CMD_BUILD_ROAD_STOP
build a road stop
Definition: command_type.h:213
@ CMD_SET_GOAL_TEXT
update goal text of a goal
Definition: command_type.h:306
@ CMD_START_STOP_VEHICLE
start or stop a vehicle
Definition: command_type.h:336
@ CMD_MOVE_RAIL_VEHICLE
move a rail vehicle (in the depot)
Definition: command_type.h:236
@ CMD_SET_GOAL_PROGRESS
update goal progress text of a goal
Definition: command_type.h:307
@ CMD_CHANGE_BANK_BALANCE
change bank balance to charge costs or give money from a GS
Definition: command_type.h:296
@ CMD_RENAME_DEPOT
rename a depot
Definition: command_type.h:269
@ CMD_RENAME_ENGINE
rename a engine (in the engine list)
Definition: command_type.h:265
@ CMD_INSERT_ORDER
insert a new order
Definition: command_type.h:244
@ CMD_TOWN_GROWTH_RATE
set the town growth rate
Definition: command_type.h:284
@ CMD_SET_GROUP_LIVERY
set the livery for a group
Definition: command_type.h:349
@ CMD_CREATE_GROUP
create a new group
Definition: command_type.h:342
@ CMD_BUILD_SINGLE_SIGNAL
build a signal
Definition: command_type.h:196
@ CMD_RENAME_TOWN
rename a town
Definition: command_type.h:281
@ CMD_REMOVE_SIGNAL_TRACK
remove signals along a track (by dragging)
Definition: command_type.h:327
@ CMD_BUILD_RAIL_STATION
build a rail station
Definition: command_type.h:194
@ CMD_AUTOREPLACE_VEHICLE
replace/renew a vehicle while it is in a depot
Definition: command_type.h:338
@ CMD_BUILD_SINGLE_RAIL
build a single rail track
Definition: command_type.h:190
@ CMD_REMOVE_GOAL
remove a goal
Definition: command_type.h:304
@ CMD_REMOVE_SINGLE_SIGNAL
remove a signal
Definition: command_type.h:197
@ CMD_RENAME_STATION
rename a station
Definition: command_type.h:268
@ CMD_BUILD_TUNNEL
build a tunnel
Definition: command_type.h:201
@ CMD_SET_COMPANY_COLOUR
set the colour of the company
Definition: command_type.h:255
@ CMD_REMOVE_STORY_PAGE_ELEMENT
remove a story page element
Definition: command_type.h:318
@ CMD_TOWN_CARGO_GOAL
set the goal of a cargo for a town
Definition: command_type.h:283
@ CMD_REMOVE_FROM_RAIL_STATION
remove a (rectangle of) tiles from a rail station
Definition: command_type.h:203
@ CMD_REMOVE_ALL_VEHICLES_GROUP
remove all vehicles from a group
Definition: command_type.h:347
@ CMD_REMOVE_ROAD_STOP
remove a road stop
Definition: command_type.h:214
@ CMD_CHANGE_SERVICE_INT
change the server interval of a vehicle
Definition: command_type.h:246
@ CMD_UPDATE_LEAGUE_TABLE_ELEMENT_SCORE
update the score of a league table element
Definition: command_type.h:363
@ CMD_DELETE_GROUP
delete a group
Definition: command_type.h:343
@ CMD_AUTOFILL_TIMETABLE
autofill the timetable
Definition: command_type.h:355
@ CMD_BULK_CHANGE_TIMETABLE
change the timetable for all orders of a vehicle
Definition: command_type.h:353
CommandFlags
Command flags for the command table _command_proc_table.
Definition: command_type.h:396
@ CMD_NO_EST
the command is never estimated.
Definition: command_type.h:407
@ CMD_SPECTATOR
the command may be initiated by a spectator
Definition: command_type.h:398
@ CMD_LOCATION
the command has implicit location argument.
Definition: command_type.h:408
@ CMD_NO_TEST
the command's output may differ between test and execute due to town rating changes etc.
Definition: command_type.h:402
@ CMD_ALL_TILES
allow this command also on MP_VOID tiles
Definition: command_type.h:401
@ CMD_SERVER
the command can only be initiated by the server
Definition: command_type.h:397
@ CMD_AUTO
set the DC_AUTO flag on this command
Definition: command_type.h:400
@ CMD_STR_CTRL
the command's string may contain control strings
Definition: command_type.h:406
@ CMD_NO_WATER
set the DC_NO_WATER flag on this command
Definition: command_type.h:403
@ CMD_CLIENT_ID
set p2 with the ClientID of the sending client.
Definition: command_type.h:404
@ CMD_DEITY
the command may be executed by COMPANY_DEITY
Definition: command_type.h:405
@ CMD_OFFLINE
the command cannot be executed in a multiplayer game; single-player only
Definition: command_type.h:399
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
Types related to the economy.
ExpensesType
Types of expenses.
Definition: economy_type.h:172
@ INVALID_EXPENSES
Invalid expense type.
Definition: economy_type.h:187
Types related to strings.
uint32_t StringID
Numeric value that represents a string, independent of the selected language.
Definition: strings_type.h:16
static const StringID INVALID_STRING_ID
Constant representing an invalid string (16bit in case it is used in savegames)
Definition: strings_type.h:17
Defines the traits of a command.
Definition: command_type.h:453
Dynamic data of a loaded NewGRF.
Definition: newgrf.h:108
Types related to tiles.