OpenTTD Source: src/engine_cmd.h Source File

OpenTTD Source 14.0-beta1

engine_cmd.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 ENGINE_CMD_H
11 #define ENGINE_CMD_H
12
13 #include "command_type.h"
14
15 CommandCost CmdWantEnginePreview(DoCommandFlag flags, EngineID engine_id);
16 CommandCost CmdEngineCtrl(DoCommandFlag flags, EngineID engine_id, CompanyID company_id, bool allow);
17 CommandCost CmdRenameEngine(DoCommandFlag flags, EngineID engine_id, const std::string &text);
18 CommandCost CmdSetVehicleVisibility(DoCommandFlag flags, EngineID engine_id, bool hide);
19
20 DEF_CMD_TRAIT(CMD_WANT_ENGINE_PREVIEW, CmdWantEnginePreview, 0, CMDT_VEHICLE_MANAGEMENT)
21 DEF_CMD_TRAIT(CMD_ENGINE_CTRL, CmdEngineCtrl, CMD_DEITY, CMDT_VEHICLE_MANAGEMENT)
22 DEF_CMD_TRAIT(CMD_RENAME_ENGINE, CmdRenameEngine, CMD_SERVER, CMDT_OTHER_MANAGEMENT)
23 DEF_CMD_TRAIT(CMD_SET_VEHICLE_VISIBILITY, CmdSetVehicleVisibility, 0, CMDT_COMPANY_SETTING)
24
25 #endif /* ENGINE_CMD_H */
CmdRenameEngine
CommandCost CmdRenameEngine(DoCommandFlag flags, EngineID engine_id, const std::string &text)
Rename an engine.
Definition: engine.cpp:1182
CmdEngineCtrl
CommandCost CmdEngineCtrl(DoCommandFlag flags, EngineID engine_id, CompanyID company_id, bool allow)
Allow or forbid a specific company to use an engine.
Definition: engine.cpp:1020
CMDT_COMPANY_SETTING
@ CMDT_COMPANY_SETTING
Changing settings related to a company.
Definition: command_type.h:415
Owner
Owner
Enum for all companies/owners.
Definition: company_type.h:18
DoCommandFlag
DoCommandFlag
List of flags for a command.
Definition: command_type.h:369
CMD_DEITY
@ CMD_DEITY
the command may be executed by COMPANY_DEITY
Definition: command_type.h:400
CommandCost
Common return value for all commands.
Definition: command_type.h:23
CMDT_OTHER_MANAGEMENT
@ CMDT_OTHER_MANAGEMENT
Renaming stuff, changing company colours, placing signs, etc.
Definition: command_type.h:414
CmdSetVehicleVisibility
CommandCost CmdSetVehicleVisibility(DoCommandFlag flags, EngineID engine_id, bool hide)
Set the visibility of an engine.
Definition: engine.cpp:981
command_type.h
CMDT_VEHICLE_MANAGEMENT
@ CMDT_VEHICLE_MANAGEMENT
Stopping, starting, sending to depot, turning around, replace orders etc.
Definition: command_type.h:412
CMD_SET_VEHICLE_VISIBILITY
@ CMD_SET_VEHICLE_VISIBILITY
hide or unhide a vehicle in the build vehicle and autoreplace GUIs
Definition: command_type.h:231
CMD_WANT_ENGINE_PREVIEW
@ CMD_WANT_ENGINE_PREVIEW
confirm the preview of an engine
Definition: command_type.h:258
CMD_RENAME_ENGINE
@ CMD_RENAME_ENGINE
rename a engine (in the engine list)
Definition: command_type.h:262
EngineID
uint16_t EngineID
Unique identification number of an engine.
Definition: engine_type.h:21
CMD_SERVER
@ CMD_SERVER
the command can only be initiated by the server
Definition: command_type.h:392
CMD_ENGINE_CTRL
@ CMD_ENGINE_CTRL
control availability of the engine for companies
Definition: command_type.h:259
CmdWantEnginePreview
CommandCost CmdWantEnginePreview(DoCommandFlag flags, EngineID engine_id)
Accept an engine prototype.
Definition: engine.cpp:1002