feat(Core/Chat): new argument parsing and unify chat hyperlink parsing (#6243)

This commit is contained in:
Kargatum
2021-10-23 15:15:42 +07:00
committed by GitHub
parent 1101f9dd2a
commit bc9473482e
90 changed files with 4280 additions and 2508 deletions

View File

@@ -1287,10 +1287,10 @@ public:
if (itr == _gameTeleStore.end()) return nullptr;
return &itr->second;
}
[[nodiscard]] GameTele const* GetGameTele(std::string const& name) const;
[[nodiscard]] GameTele const* GetGameTele(std::string_view name) const;
[[nodiscard]] GameTeleContainer const& GetGameTeleMap() const { return _gameTeleStore; }
bool AddGameTele(GameTele& data);
bool DeleteGameTele(std::string const& name);
bool DeleteGameTele(std::string_view name);
[[nodiscard]] TrainerSpellData const* GetNpcTrainerSpells(uint32 entry) const
{
@@ -1344,6 +1344,13 @@ public:
}
static void AddLocaleString(std::string&& s, LocaleConstant locale, std::vector<std::string>& data);
static std::string_view GetLocaleString(std::vector<std::string> const& data, size_t locale)
{
if (locale < data.size())
return data[locale];
else
return {};
}
static inline void GetLocaleString(const std::vector<std::string>& data, int loc_idx, std::string& value)
{
if (data.size() > size_t(loc_idx) && !data[loc_idx].empty())