AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
LinkValidator< LinkTags::enchant > Struct Reference

Static Public Member Functions

static bool IsTextValid (SpellInfo const *info, std::string_view text)
 
static bool IsColorValid (SpellInfo const *, HyperlinkColor c)
 

Detailed Description

Member Function Documentation

◆ IsColorValid()

static bool LinkValidator< LinkTags::enchant >::IsColorValid ( SpellInfo const *  ,
HyperlinkColor  c 
)
inlinestatic
268 {
269 return c == CHAT_LINK_COLOR_ENCHANT;
270 }
@ CHAT_LINK_COLOR_ENCHANT
Definition: SharedDefines.h:3213

References CHAT_LINK_COLOR_ENCHANT.

◆ IsTextValid()

static bool LinkValidator< LinkTags::enchant >::IsTextValid ( SpellInfo const *  info,
std::string_view  text 
)
inlinestatic
238 {
240 return true;
241
242 SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(info->Id);
243 if (bounds.first == bounds.second)
244 return false;
245
246 for (auto pair = bounds.first; pair != bounds.second; ++pair)
247 {
248 SkillLineEntry const* skill = sSkillLineStore.LookupEntry(pair->second->SkillLine);
249 if (!skill)
250 return false;
251
252 for (uint8 i = 0; i < TOTAL_LOCALES; ++i)
253 {
254 std::string_view skillName = skill->name[i];
255 std::string_view spellName = info->SpellName[i];
256 // alternate form [Skill Name: Spell Name]
257 if ((text.length() == (skillName.length() + 2 + spellName.length())) &&
258 (text.substr(0, skillName.length()) == skillName) &&
259 (text.substr(skillName.length(), 2) == ": ") &&
260 (text.substr(skillName.length() + 2) == spellName))
261 return true;
262 }
263 }
264 return false;
265 }
@ TOTAL_LOCALES
Definition: Common.h:78
std::uint8_t uint8
Definition: Define.h:110
DBCStorage< SkillLineEntry > sSkillLineStore(SkillLinefmt)
#define sSpellMgr
Definition: SpellMgr.h:825
std::pair< SkillLineAbilityMap::const_iterator, SkillLineAbilityMap::const_iterator > SkillLineAbilityMapBounds
Definition: SpellMgr.h:584
Definition: Hyperlinks.cpp:105
Definition: DBCStructure.h:1581
char const * name[16]
Definition: DBCStructure.h:1585

References SpellInfo::Id, SkillLineEntry::name, SpellInfo::SpellName, sSkillLineStore, sSpellMgr, and TOTAL_LOCALES.