OpenTTD Source: src/league_cmd.h Source File

OpenTTD Source 13.2.1

league_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 LEAGUE_CMD_H
11 #define LEAGUE_CMD_H
12
13 #include "league_type.h"
14 #include "command_type.h"
15 #include "company_type.h"
16
17 std::tuple<CommandCost, LeagueTableID> CmdCreateLeagueTable(DoCommandFlag flags, const std::string &title, const std::string &header, const std::string &footer);
18 std::tuple<CommandCost, LeagueTableElementID> CmdCreateLeagueTableElement(DoCommandFlag flags, LeagueTableID table, int64 rating, CompanyID company, const std::string &text, const std::string &score, LinkType link_type, LinkTargetID link_target);
19 CommandCost CmdUpdateLeagueTableElementData(DoCommandFlag flags, LeagueTableElementID element, CompanyID company, const std::string &text, LinkType link_type, LinkTargetID link_target);
20 CommandCost CmdUpdateLeagueTableElementScore(DoCommandFlag flags, LeagueTableElementID element, int64 rating, const std::string &score);
21 CommandCost CmdRemoveLeagueTableElement(DoCommandFlag flags, LeagueTableElementID element);
22
23 DEF_CMD_TRAIT(CMD_CREATE_LEAGUE_TABLE, CmdCreateLeagueTable, CMD_DEITY | CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT)
24 DEF_CMD_TRAIT(CMD_CREATE_LEAGUE_TABLE_ELEMENT, CmdCreateLeagueTableElement, CMD_DEITY | CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT)
25 DEF_CMD_TRAIT(CMD_UPDATE_LEAGUE_TABLE_ELEMENT_DATA, CmdUpdateLeagueTableElementData, CMD_DEITY | CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT)
26 DEF_CMD_TRAIT(CMD_UPDATE_LEAGUE_TABLE_ELEMENT_SCORE, CmdUpdateLeagueTableElementScore, CMD_DEITY | CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT)
27 DEF_CMD_TRAIT(CMD_REMOVE_LEAGUE_TABLE_ELEMENT, CmdRemoveLeagueTableElement, CMD_DEITY, CMDT_OTHER_MANAGEMENT)
28
29 #endif /* LEAGUE_CMD_H */
league_type.h
CMD_UPDATE_LEAGUE_TABLE_ELEMENT_DATA
@ CMD_UPDATE_LEAGUE_TABLE_ELEMENT_DATA
update the data fields of a league table element
Definition: command_type.h:343
CmdCreateLeagueTableElement
std::tuple< CommandCost, LeagueTableElementID > CmdCreateLeagueTableElement(DoCommandFlag flags, LeagueTableID table, int64 rating, CompanyID company, const std::string &text, const std::string &score, LinkType link_type, LinkTargetID link_target)
Create a new element in a league table.
Definition: league_cmd.cpp:86
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_DEITY
@ CMD_DEITY
the command may be executed by COMPANY_DEITY
Definition: command_type.h:386
CmdRemoveLeagueTableElement
CommandCost CmdRemoveLeagueTableElement(DoCommandFlag flags, LeagueTableElementID element)
Remove a league table element.
Definition: league_cmd.cpp:164
CMD_UPDATE_LEAGUE_TABLE_ELEMENT_SCORE
@ CMD_UPDATE_LEAGUE_TABLE_ELEMENT_SCORE
update the score of a league table element
Definition: command_type.h:344
LinkTargetID
uint32 LinkTargetID
Contains either tile, industry ID, town ID, story page ID or company ID.
Definition: league_type.h:23
LinkType
LinkType
Types of the possible link targets.
Definition: league_type.h:14
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
CmdCreateLeagueTable
std::tuple< CommandCost, LeagueTableID > CmdCreateLeagueTable(DoCommandFlag flags, const std::string &title, const std::string &header, const std::string &footer)
Create a new league table.
Definition: league_cmd.cpp:56
LeagueTableID
uint8 LeagueTableID
ID of a league table.
Definition: league_type.h:32
command_type.h
LeagueTableElementID
uint16 LeagueTableElementID
ID of a league table element.
Definition: league_type.h:36
CmdUpdateLeagueTableElementData
CommandCost CmdUpdateLeagueTableElementData(DoCommandFlag flags, LeagueTableElementID element, CompanyID company, const std::string &text, LinkType link_type, LinkTargetID link_target)
Update the attributes of a league table element.
Definition: league_cmd.cpp:118
CMD_CREATE_LEAGUE_TABLE
@ CMD_CREATE_LEAGUE_TABLE
create a new league table
Definition: command_type.h:341
CMD_CREATE_LEAGUE_TABLE_ELEMENT
@ CMD_CREATE_LEAGUE_TABLE_ELEMENT
create a new element in a league table
Definition: command_type.h:342
CmdUpdateLeagueTableElementScore
CommandCost CmdUpdateLeagueTableElementScore(DoCommandFlag flags, LeagueTableElementID element, int64 rating, const std::string &score)
Update the score of a league table element.
Definition: league_cmd.cpp:144
CMD_STR_CTRL
@ CMD_STR_CTRL
the command's string may contain control strings
Definition: command_type.h:387
CMD_REMOVE_LEAGUE_TABLE_ELEMENT
@ CMD_REMOVE_LEAGUE_TABLE_ELEMENT
remove a league table element
Definition: command_type.h:345
company_type.h