OpenTTD Source: src/company_cmd.h Source File

OpenTTD Source 13.1

company_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 COMPANY_CMD_H
11 #define COMPANY_CMD_H
12
13 #include "command_type.h"
14 #include "company_type.h"
15 #include "livery.h"
16
17 enum ClientID : uint32;
18 enum Colours : byte;
19
20 CommandCost CmdCompanyCtrl(DoCommandFlag flags, CompanyCtrlAction cca, CompanyID company_id, CompanyRemoveReason reason, ClientID client_id);
21 CommandCost CmdGiveMoney(DoCommandFlag flags, uint32 money, CompanyID dest_company);
22 CommandCost CmdRenameCompany(DoCommandFlag flags, const std::string &text);
23 CommandCost CmdRenamePresident(DoCommandFlag flags, const std::string &text);
24 CommandCost CmdSetCompanyManagerFace(DoCommandFlag flags, CompanyManagerFace cmf);
25 CommandCost CmdSetCompanyColour(DoCommandFlag flags, LiveryScheme scheme, bool primary, Colours colour);
26
27 DEF_CMD_TRAIT(CMD_COMPANY_CTRL, CmdCompanyCtrl, CMD_SPECTATOR | CMD_CLIENT_ID | CMD_NO_EST, CMDT_SERVER_SETTING)
28 DEF_CMD_TRAIT(CMD_GIVE_MONEY, CmdGiveMoney, 0, CMDT_MONEY_MANAGEMENT)
29 DEF_CMD_TRAIT(CMD_RENAME_COMPANY, CmdRenameCompany, 0, CMDT_OTHER_MANAGEMENT)
30 DEF_CMD_TRAIT(CMD_RENAME_PRESIDENT, CmdRenamePresident, 0, CMDT_OTHER_MANAGEMENT)
31 DEF_CMD_TRAIT(CMD_SET_COMPANY_MANAGER_FACE, CmdSetCompanyManagerFace, 0, CMDT_OTHER_MANAGEMENT)
32 DEF_CMD_TRAIT(CMD_SET_COMPANY_COLOUR, CmdSetCompanyColour, 0, CMDT_OTHER_MANAGEMENT)
33
34 #endif /* COMPANY_CMD_H */
CompanyCtrlAction
CompanyCtrlAction
The action to do with CMD_COMPANY_CTRL.
Definition: company_type.h:67
CMD_SET_COMPANY_COLOUR
@ CMD_SET_COMPANY_COLOUR
set the colour of the company
Definition: command_type.h:238
CompanyManagerFace
uint32 CompanyManagerFace
Company manager face bits, info see in company_manager_face.h.
Definition: company_type.h:52
CmdRenamePresident
CommandCost CmdRenamePresident(DoCommandFlag flags, const std::string &text)
Change the name of the president.
Definition: company_cmd.cpp:1102
CMD_NO_EST
@ CMD_NO_EST
the command is never estimated.
Definition: command_type.h:388
LiveryScheme
LiveryScheme
List of different livery schemes.
Definition: livery.h:20
CmdSetCompanyColour
CommandCost CmdSetCompanyColour(DoCommandFlag flags, LiveryScheme scheme, bool primary, Colours colour)
Change the company's company-colour.
Definition: company_cmd.cpp:955
CmdRenameCompany
CommandCost CmdRenameCompany(DoCommandFlag flags, const std::string &text)
Change the name of the company.
Definition: company_cmd.cpp:1059
CMD_SET_COMPANY_MANAGER_FACE
@ CMD_SET_COMPANY_MANAGER_FACE
set the manager's face of the company
Definition: command_type.h:237
Owner
Owner
Enum for all companies/owners.
Definition: company_type.h:18
DoCommandFlag
DoCommandFlag
List of flags for a command.
Definition: command_type.h:355
CMD_GIVE_MONEY
@ CMD_GIVE_MONEY
give money to another company
Definition: command_type.h:310
CommandCost
Common return value for all commands.
Definition: command_type.h:24
CMDT_OTHER_MANAGEMENT
@ CMDT_OTHER_MANAGEMENT
Renaming stuff, changing company colours, placing signs, etc.
Definition: command_type.h:400
ClientID
ClientID
'Unique' identifier to be given to clients
Definition: network_type.h:47
CMD_COMPANY_CTRL
@ CMD_COMPANY_CTRL
used in multiplayer to create a new companies etc.
Definition: command_type.h:283
CMD_CLIENT_ID
@ CMD_CLIENT_ID
set p2 with the ClientID of the sending client.
Definition: command_type.h:385
CmdGiveMoney
CommandCost CmdGiveMoney(DoCommandFlag flags, uint32 money, CompanyID dest_company)
Transfer funds (money) from one company to another.
Definition: company_cmd.cpp:1185
livery.h
command_type.h
CMD_RENAME_PRESIDENT
@ CMD_RENAME_PRESIDENT
change the president name
Definition: command_type.h:249
CMDT_SERVER_SETTING
@ CMDT_SERVER_SETTING
Pausing/removing companies/server settings.
Definition: command_type.h:402
CmdCompanyCtrl
enum ClientID uint32 enum Colours byte CommandCost CmdCompanyCtrl(DoCommandFlag flags, CompanyCtrlAction cca, CompanyID company_id, CompanyRemoveReason reason, ClientID client_id)
Control the companies: add, delete, etc.
Definition: company_cmd.cpp:816
CMD_SPECTATOR
@ CMD_SPECTATOR
the command may be initiated by a spectator
Definition: command_type.h:379
CMD_RENAME_COMPANY
@ CMD_RENAME_COMPANY
change the company name
Definition: command_type.h:248
company_type.h
CMDT_MONEY_MANAGEMENT
@ CMDT_MONEY_MANAGEMENT
Management of money, i.e. loans and shares.
Definition: command_type.h:397
CompanyRemoveReason
CompanyRemoveReason
The reason why the company was removed.
Definition: company_type.h:56
CmdSetCompanyManagerFace
CommandCost CmdSetCompanyManagerFace(DoCommandFlag flags, CompanyManagerFace cmf)
Change the company manager's face.
Definition: company_cmd.cpp:936