OpenTTD Source: src/company_cmd.h Source File

OpenTTD Source 15.0-beta1

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
17enum ClientID : uint32_t;
18enum Colours : uint8_t;
19
20 CommandCost CmdCompanyCtrl(DoCommandFlag flags, CompanyCtrlAction cca, CompanyID company_id, CompanyRemoveReason reason, ClientID client_id);
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);
25 CommandCost CmdSetCompanyManagerFace(DoCommandFlag flags, CompanyManagerFace cmf);
26 CommandCost CmdSetCompanyColour(DoCommandFlag flags, LiveryScheme scheme, bool primary, Colours colour);
27
28DEF_CMD_TRAIT(CMD_COMPANY_CTRL, CmdCompanyCtrl, CMD_SPECTATOR | CMD_CLIENT_ID | CMD_NO_EST, CMDT_SERVER_SETTING)
29DEF_CMD_TRAIT(CMD_COMPANY_ALLOW_LIST_CTRL, CmdCompanyAllowListCtrl, CMD_NO_EST, CMDT_SERVER_SETTING)
30DEF_CMD_TRAIT(CMD_GIVE_MONEY, CmdGiveMoney, 0, CMDT_MONEY_MANAGEMENT)
31DEF_CMD_TRAIT(CMD_RENAME_COMPANY, CmdRenameCompany, 0, CMDT_COMPANY_SETTING)
32DEF_CMD_TRAIT(CMD_RENAME_PRESIDENT, CmdRenamePresident, 0, CMDT_COMPANY_SETTING)
33DEF_CMD_TRAIT(CMD_SET_COMPANY_MANAGER_FACE, CmdSetCompanyManagerFace, 0, CMDT_COMPANY_SETTING)
34DEF_CMD_TRAIT(CMD_SET_COMPANY_COLOUR, CmdSetCompanyColour, 0, CMDT_COMPANY_SETTING)
35
36#endif /* COMPANY_CMD_H */
CommandCost
Common return value for all commands.
Definition command_type.h:23
OverflowSafeInt< int64_t >
command_type.h
Types related to commands.
CMDT_COMPANY_SETTING
@ CMDT_COMPANY_SETTING
Changing settings related to a company.
Definition command_type.h:420
CMDT_MONEY_MANAGEMENT
@ CMDT_MONEY_MANAGEMENT
Management of money, i.e. loans.
Definition command_type.h:416
CMDT_SERVER_SETTING
@ CMDT_SERVER_SETTING
Pausing/removing companies/server settings.
Definition command_type.h:421
DoCommandFlag
DoCommandFlag
List of flags for a command.
Definition command_type.h:374
CMD_COMPANY_CTRL
@ CMD_COMPANY_CTRL
used in multiplayer to create a new companies etc.
Definition command_type.h:300
CMD_RENAME_COMPANY
@ CMD_RENAME_COMPANY
change the company name
Definition command_type.h:266
CMD_SET_COMPANY_MANAGER_FACE
@ CMD_SET_COMPANY_MANAGER_FACE
set the manager's face of the company
Definition command_type.h:254
CMD_GIVE_MONEY
@ CMD_GIVE_MONEY
give money to another company
Definition command_type.h:329
CMD_RENAME_PRESIDENT
@ CMD_RENAME_PRESIDENT
change the president name
Definition command_type.h:267
CMD_COMPANY_ALLOW_LIST_CTRL
@ 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
@ CMD_SET_COMPANY_COLOUR
set the colour of the company
Definition command_type.h:255
CMD_NO_EST
@ CMD_NO_EST
the command is never estimated.
Definition command_type.h:407
CMD_SPECTATOR
@ CMD_SPECTATOR
the command may be initiated by a spectator
Definition command_type.h:398
CMD_CLIENT_ID
@ CMD_CLIENT_ID
set p2 with the ClientID of the sending client.
Definition command_type.h:404
CmdSetCompanyColour
CommandCost CmdSetCompanyColour(DoCommandFlag flags, LiveryScheme scheme, bool primary, Colours colour)
Change the company's company-colour.
Definition company_cmd.cpp:1070
CmdCompanyCtrl
CommandCost CmdCompanyCtrl(DoCommandFlag flags, CompanyCtrlAction cca, CompanyID company_id, CompanyRemoveReason reason, ClientID client_id)
Control the companies: add, delete, etc.
Definition company_cmd.cpp:864
CmdSetCompanyManagerFace
CommandCost CmdSetCompanyManagerFace(DoCommandFlag flags, CompanyManagerFace cmf)
Change the company manager's face.
Definition company_cmd.cpp:1037
CmdGiveMoney
CommandCost CmdGiveMoney(DoCommandFlag flags, Money money, CompanyID dest_company)
Transfer funds (money) from one company to another.
Definition company_cmd.cpp:1296
CmdRenamePresident
CommandCost CmdRenamePresident(DoCommandFlag flags, const std::string &text)
Change the name of the president.
Definition company_cmd.cpp:1212
CmdCompanyAllowListCtrl
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.
Definition company_cmd.cpp:1004
CmdRenameCompany
CommandCost CmdRenameCompany(DoCommandFlag flags, const std::string &text)
Change the name of the company.
Definition company_cmd.cpp:1169
company_type.h
Types related to companies.
CompanyCtrlAction
CompanyCtrlAction
The action to do with CMD_COMPANY_CTRL.
Definition company_type.h:67
CompanyAllowListCtrlAction
CompanyAllowListCtrlAction
The action to do with CMD_COMPANY_ALLOW_LIST_CTRL.
Definition company_type.h:76
CompanyManagerFace
uint32_t CompanyManagerFace
Company manager face bits, info see in company_manager_face.h.
Definition company_type.h:53
Owner
Owner
Enum for all companies/owners.
Definition company_type.h:18
CompanyRemoveReason
CompanyRemoveReason
The reason why the company was removed.
Definition company_type.h:56
livery.h
Functions/types related to livery colours.
LiveryScheme
LiveryScheme
List of different livery schemes.
Definition livery.h:21
ClientID
ClientID
'Unique' identifier to be given to clients
Definition network_type.h:49