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
269 {
270 return c == CHAT_LINK_COLOR_ENCHANT;
271 }
@ CHAT_LINK_COLOR_ENCHANT
Definition: SharedDefines.h:3185

References CHAT_LINK_COLOR_ENCHANT.

◆ IsTextValid()

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

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