OpenTTD Source  20241121-master-g67a0fccfad
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_t;
18 enum Colours : uint8_t;
19 
21 CommandCost CmdCompanyAllowListCtrl(DoCommandFlag flags, CompanyAllowListCtrlAction action, const std::string &public_key);
22 CommandCost CmdGiveMoney(DoCommandFlag flags, Money money, CompanyID dest_company);
23 CommandCost CmdRenameCompany(DoCommandFlag flags, const std::string &text);
24 CommandCost CmdRenamePresident(DoCommandFlag flags, const std::string &text);
26 CommandCost CmdSetCompanyColour(DoCommandFlag flags, LiveryScheme scheme, bool primary, Colours colour);
27 
35 
36 #endif /* COMPANY_CMD_H */
Common return value for all commands.
Definition: command_type.h:23
Types related to commands.
@ CMDT_COMPANY_SETTING
Changing settings related to a company.
Definition: command_type.h:420
@ 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
@ CMD_COMPANY_CTRL
used in multiplayer to create a new companies etc.
Definition: command_type.h:300
@ CMD_RENAME_COMPANY
change the company name
Definition: command_type.h:266
@ CMD_SET_COMPANY_MANAGER_FACE
set the manager's face of the company
Definition: command_type.h:254
@ CMD_GIVE_MONEY
give money to another company
Definition: command_type.h:329
@ CMD_RENAME_PRESIDENT
change the president name
Definition: command_type.h:267
@ 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_SET_COMPANY_COLOUR
set the colour of the company
Definition: command_type.h:255
@ 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_CLIENT_ID
set p2 with the ClientID of the sending client.
Definition: command_type.h:404
CommandCost CmdSetCompanyColour(DoCommandFlag flags, LiveryScheme scheme, bool primary, Colours colour)
Change the company's company-colour.
CommandCost CmdSetCompanyManagerFace(DoCommandFlag flags, CompanyManagerFace cmf)
Change the company manager's face.
CommandCost CmdGiveMoney(DoCommandFlag flags, Money money, CompanyID dest_company)
Transfer funds (money) from one company to another.
CommandCost CmdRenamePresident(DoCommandFlag flags, const std::string &text)
Change the name of the president.
enum ClientID uint32_t enum Colours uint8_t CommandCost CmdCompanyCtrl(DoCommandFlag flags, CompanyCtrlAction cca, CompanyID company_id, CompanyRemoveReason reason, ClientID client_id)
Control the companies: add, delete, etc.
CommandCost CmdCompanyAllowListCtrl(DoCommandFlag flags, CompanyAllowListCtrlAction action, const std::string &public_key)
Add or remove the given public key to the allow list of this company.
CommandCost CmdRenameCompany(DoCommandFlag flags, const std::string &text)
Change the name of the company.
Types related to companies.
CompanyCtrlAction
The action to do with CMD_COMPANY_CTRL.
Definition: company_type.h:67
CompanyAllowListCtrlAction
The action to do with CMD_COMPANY_ALLOW_LIST_CTRL.
Definition: company_type.h:76
uint32_t CompanyManagerFace
Company manager face bits, info see in company_manager_face.h.
Definition: company_type.h:52
Owner
Enum for all companies/owners.
Definition: company_type.h:18
CompanyRemoveReason
The reason why the company was removed.
Definition: company_type.h:56
Functions/types related to livery colours.
LiveryScheme
List of different livery schemes.
Definition: livery.h:21
ClientID
'Unique' identifier to be given to clients
Definition: network_type.h:49