OpenTTD Source 20250312-master-gcdcc6b491d
|
Command definitions related to league tables. More...
Go to the source code of this file.
Functions | |
std::tuple< CommandCost, LeagueTableID > | CmdCreateLeagueTable (DoCommandFlags flags, const EncodedString &title, const EncodedString &header, const EncodedString &footer) |
Create a new league table. | |
std::tuple< CommandCost, LeagueTableElementID > | CmdCreateLeagueTableElement (DoCommandFlags flags, LeagueTableID table, int64_t rating, CompanyID company, const EncodedString &text, const EncodedString &score, LinkType link_type, LinkTargetID link_target) |
Create a new element in a league table. | |
CommandCost | CmdUpdateLeagueTableElementData (DoCommandFlags flags, LeagueTableElementID element, CompanyID company, const EncodedString &text, LinkType link_type, LinkTargetID link_target) |
Update the attributes of a league table element. | |
CommandCost | CmdUpdateLeagueTableElementScore (DoCommandFlags flags, LeagueTableElementID element, int64_t rating, const EncodedString &score) |
Update the score of a league table element. | |
CommandCost | CmdRemoveLeagueTableElement (DoCommandFlags flags, LeagueTableElementID element) |
Remove a league table element. | |
Command definitions related to league tables.
Definition in file league_cmd.h.
std::tuple< CommandCost, LeagueTableID > CmdCreateLeagueTable | ( | DoCommandFlags | flags, |
const EncodedString & | title, | ||
const EncodedString & | header, | ||
const EncodedString & | footer | ||
) |
Create a new league table.
flags | type of operation |
title | Title of the league table |
header | Text to show above the table |
footer | Text to show below the table |
Definition at line 56 of file league_cmd.cpp.
References _current_company, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_league_table_pool >::CanAllocateItem(), CMD_ERROR, Execute, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem< Tpool >::index, OWNER_DEITY, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().
std::tuple< CommandCost, LeagueTableElementID > CmdCreateLeagueTableElement | ( | DoCommandFlags | flags, |
LeagueTableID | table, | ||
int64_t | rating, | ||
CompanyID | company, | ||
const EncodedString & | text, | ||
const EncodedString & | score, | ||
LinkType | link_type, | ||
LinkTargetID | link_target | ||
) |
Create a new element in a league table.
flags | type of operation |
table | Id of the league table this element belongs to |
rating | Value that elements are ordered by |
company | Company to show the color blob for or CompanyID::Invalid() |
text | Text of the element |
score | String representation of the score associated with the element |
link_type | Type of the referenced object |
link_target | Id of the referenced object |
Definition at line 83 of file league_cmd.cpp.
References _current_company, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_league_table_element_pool >::CanAllocateItem(), CMD_ERROR, Execute, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem< Tpool >::index, InvalidateWindowData(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::IsValidID(), IsValidLink(), OWNER_DEITY, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), and WC_COMPANY_LEAGUE.
CommandCost CmdRemoveLeagueTableElement | ( | DoCommandFlags | flags, |
LeagueTableElementID | element | ||
) |
Remove a league table element.
flags | type of operation |
element | Id of the element to update |
Definition at line 155 of file league_cmd.cpp.
References _current_company, CMD_ERROR, Execute, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_league_table_element_pool >::GetIfValid(), InvalidateWindowData(), OWNER_DEITY, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), and WC_COMPANY_LEAGUE.
CommandCost CmdUpdateLeagueTableElementData | ( | DoCommandFlags | flags, |
LeagueTableElementID | element, | ||
CompanyID | company, | ||
const EncodedString & | text, | ||
LinkType | link_type, | ||
LinkTargetID | link_target | ||
) |
Update the attributes of a league table element.
flags | type of operation |
element | Id of the element to update |
company | Company to show the color blob for or CompanyID::Invalid() |
text | Text of the element |
link_type | Type of the referenced object |
link_target | Id of the referenced object |
Definition at line 109 of file league_cmd.cpp.
References _current_company, CMD_ERROR, Execute, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_league_table_element_pool >::GetIfValid(), InvalidateWindowData(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::IsValidID(), IsValidLink(), OWNER_DEITY, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), and WC_COMPANY_LEAGUE.
CommandCost CmdUpdateLeagueTableElementScore | ( | DoCommandFlags | flags, |
LeagueTableElementID | element, | ||
int64_t | rating, | ||
const EncodedString & | score | ||
) |
Update the score of a league table element.
flags | type of operation |
element | Id of the element to update |
rating | Value that elements are ordered by |
score | String representation of the score associated with the element |
Definition at line 135 of file league_cmd.cpp.
References _current_company, CMD_ERROR, Execute, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_league_table_element_pool >::GetIfValid(), InvalidateWindowData(), OWNER_DEITY, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), and WC_COMPANY_LEAGUE.