1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-17 01:12:39 +01:00

Codechange: strongly type StoryPageID and StoryPageElementID

This commit is contained in:
Rubidium
2025-02-01 00:28:08 +01:00
committed by rubidium42
parent 5ca5790ac8
commit 3aa60fd479
5 changed files with 13 additions and 11 deletions

View File

@@ -56,7 +56,7 @@ static inline bool StoryPageElementTypeRequiresText(StoryPageElementType type)
c, title != nullptr ? title->GetEncodedText() : std::string{})) return STORY_PAGE_INVALID;
/* In case of test-mode, we return StoryPageID 0 */
return static_cast<StoryPageID>(0);
return StoryPageID::Begin();
}
/* static */ StoryPageElementID ScriptStoryPage::NewElement(StoryPageID story_page_id, StoryPageElementType type, SQInteger reference, Text *text)
@@ -103,7 +103,7 @@ static inline bool StoryPageElementTypeRequiresText(StoryPageElementType type)
encoded_text)) return STORY_PAGE_ELEMENT_INVALID;
/* In case of test-mode, we return StoryPageElementID 0 */
return static_cast<StoryPageElementID>(0);
return StoryPageElementID::Begin();
}
/* static */ bool ScriptStoryPage::UpdateElement(StoryPageElementID story_page_element_id, SQInteger reference, Text *text)