mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-11 07:18:11 -05:00
Add scriptstrings from loaded zones to newly linked zone
This commit is contained in:
@ -24,6 +24,17 @@ scr_string_t ZoneScriptStrings::AddScriptString(const std::string& value)
|
||||
return newScrStringIndex;
|
||||
}
|
||||
|
||||
scr_string_t ZoneScriptStrings::GetScriptString(const std::string& value) const
|
||||
{
|
||||
const auto existingScriptString = m_scr_string_lookup.find(value);
|
||||
if (existingScriptString != m_scr_string_lookup.end())
|
||||
return existingScriptString->second;
|
||||
|
||||
std::ostringstream str;
|
||||
str << "Unable to find script string \"" << value << "\"";
|
||||
throw std::runtime_error(str.str());
|
||||
}
|
||||
|
||||
size_t ZoneScriptStrings::Count() const
|
||||
{
|
||||
return m_scr_strings.size();
|
||||
|
@ -15,6 +15,7 @@ class ZoneScriptStrings
|
||||
|
||||
public:
|
||||
scr_string_t AddScriptString(const std::string& value);
|
||||
scr_string_t GetScriptString(const std::string& value) const;
|
||||
_NODISCARD size_t Count() const;
|
||||
_NODISCARD bool Empty() const;
|
||||
|
||||
|
Reference in New Issue
Block a user