OpenTTD Source: src/misc_cmd.h Source File

OpenTTD Source 14.0-RC3

misc_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 MISC_CMD_H
11 #define MISC_CMD_H
12
13 #include "command_type.h"
14 #include "economy_type.h"
15
16 enum PauseMode : byte;
17
18 enum class LoanCommand : byte {
19 Interval,
20 Max,
21 Amount,
22 };
23
24 CommandCost CmdMoneyCheat(DoCommandFlag flags, Money amount);
25 CommandCost CmdChangeBankBalance(DoCommandFlag flags, TileIndex tile, Money delta, CompanyID company, ExpensesType expenses_type);
26 CommandCost CmdIncreaseLoan(DoCommandFlag flags, LoanCommand cmd, Money amount);
27 CommandCost CmdDecreaseLoan(DoCommandFlag flags, LoanCommand cmd, Money amount);
28 CommandCost CmdSetCompanyMaxLoan(DoCommandFlag flags, CompanyID company, Money amount);
29 CommandCost CmdPause(DoCommandFlag flags, PauseMode mode, bool pause);
30
31 DEF_CMD_TRAIT(CMD_MONEY_CHEAT, CmdMoneyCheat, CMD_OFFLINE, CMDT_CHEAT)
32 DEF_CMD_TRAIT(CMD_CHANGE_BANK_BALANCE, CmdChangeBankBalance, CMD_DEITY, CMDT_MONEY_MANAGEMENT)
33 DEF_CMD_TRAIT(CMD_INCREASE_LOAN, CmdIncreaseLoan, 0, CMDT_MONEY_MANAGEMENT)
34 DEF_CMD_TRAIT(CMD_DECREASE_LOAN, CmdDecreaseLoan, 0, CMDT_MONEY_MANAGEMENT)
35 DEF_CMD_TRAIT(CMD_SET_COMPANY_MAX_LOAN, CmdSetCompanyMaxLoan, CMD_DEITY, CMDT_MONEY_MANAGEMENT)
36 DEF_CMD_TRAIT(CMD_PAUSE, CmdPause, CMD_SERVER | CMD_NO_EST, CMDT_SERVER_SETTING)
37
38 #endif /* MISC_CMD_H */
CmdDecreaseLoan
CommandCost CmdDecreaseLoan(DoCommandFlag flags, LoanCommand cmd, Money amount)
Decrease the loan of your company.
Definition: misc_cmd.cpp:86
CMD_OFFLINE
@ CMD_OFFLINE
the command cannot be executed in a multiplayer game; single-player only
Definition: command_type.h:394
CMD_INCREASE_LOAN
@ CMD_INCREASE_LOAN
increase the loan from the bank
Definition: command_type.h:254
CMD_NO_EST
@ CMD_NO_EST
the command is never estimated.
Definition: command_type.h:402
CMD_DECREASE_LOAN
@ CMD_DECREASE_LOAN
decrease the loan from the bank
Definition: command_type.h:255
StrongType::Typedef< uint32_t, struct TileIndexTag, StrongType::Compare, StrongType::Integer, StrongType::Compatible< int32_t >, StrongType::Compatible< int64_t > >
CMDT_CHEAT
@ CMDT_CHEAT
A cheat of some sorts.
Definition: command_type.h:417
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
PauseMode
PauseMode
Modes of pausing we've got.
Definition: openttd.h:68
CMD_PAUSE
@ CMD_PAUSE
pause the game
Definition: command_type.h:273
CmdPause
CommandCost CmdPause(DoCommandFlag flags, PauseMode mode, bool pause)
Pause/Unpause the game (server-only).
Definition: misc_cmd.cpp:169
CmdChangeBankBalance
CommandCost CmdChangeBankBalance(DoCommandFlag flags, TileIndex tile, Money delta, CompanyID company, ExpensesType expenses_type)
Change the bank bank balance of a company by inserting or removing money without affecting the loan.
Definition: misc_cmd.cpp:236
CMD_MONEY_CHEAT
@ CMD_MONEY_CHEAT
do the money cheat
Definition: command_type.h:291
command_type.h
CmdSetCompanyMaxLoan
CommandCost CmdSetCompanyMaxLoan(DoCommandFlag flags, CompanyID company, Money amount)
Sets the max loan amount of your company.
Definition: misc_cmd.cpp:127
CmdMoneyCheat
CommandCost CmdMoneyCheat(DoCommandFlag flags, Money amount)
Change the financial flow of your company.
Definition: misc_cmd.cpp:222
CMDT_SERVER_SETTING
@ CMDT_SERVER_SETTING
Pausing/removing companies/server settings.
Definition: command_type.h:416
CMD_SET_COMPANY_MAX_LOAN
@ CMD_SET_COMPANY_MAX_LOAN
sets the max loan for the company
Definition: command_type.h:256
OverflowSafeInt< int64_t >
CmdIncreaseLoan
CommandCost CmdIncreaseLoan(DoCommandFlag flags, LoanCommand cmd, Money amount)
Increase the loan of your company.
Definition: misc_cmd.cpp:39
CMD_SERVER
@ CMD_SERVER
the command can only be initiated by the server
Definition: command_type.h:392
ExpensesType
ExpensesType
Types of expenses.
Definition: economy_type.h:172
economy_type.h
CMD_CHANGE_BANK_BALANCE
@ CMD_CHANGE_BANK_BALANCE
change bank balance to charge costs or give money from a GS
Definition: command_type.h:292
CMDT_MONEY_MANAGEMENT
@ CMDT_MONEY_MANAGEMENT
Management of money, i.e. loans.
Definition: command_type.h:411