1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-24 04:34:16 +01:00

Codechange: strongly type LeagueTableID and LeagueTableElementID

This commit is contained in:
Rubidium
2025-01-31 21:37:32 +01:00
committed by rubidium42
parent 6aada55e96
commit 6c8915fdbc
5 changed files with 12 additions and 11 deletions

View File

@@ -41,7 +41,7 @@
if (!ScriptObject::Command<CMD_CREATE_LEAGUE_TABLE>::Do(&ScriptInstance::DoCommandReturnLeagueTableID, encoded_title, encoded_header, encoded_footer)) return LEAGUE_TABLE_INVALID;
/* In case of test-mode, we return LeagueTableID 0 */
return static_cast<LeagueTableID>(0);
return LeagueTableID::Begin();
}
/* static */ bool ScriptLeagueTable::IsValidLeagueTableElement(LeagueTableElementID element_id)
@@ -74,7 +74,7 @@
if (!ScriptObject::Command<CMD_CREATE_LEAGUE_TABLE_ELEMENT>::Do(&ScriptInstance::DoCommandReturnLeagueTableElementID, table, rating, c, encoded_text, encoded_score, (::LinkType)link_type, (::LinkTargetID)link_target)) return LEAGUE_TABLE_ELEMENT_INVALID;
/* In case of test-mode, we return LeagueTableElementID 0 */
return static_cast<LeagueTableElementID>(0);
return LeagueTableElementID::Begin();
}
/* static */ bool ScriptLeagueTable::UpdateElementData(LeagueTableElementID element, ScriptCompany::CompanyID company, Text *text, LinkType link_type, SQInteger link_target)