AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Acore::Hyperlinks::LinkTags::achievement Struct Reference

#include "Hyperlinks.h"

Public Types

using value_type = AchievementLinkData const &
 

Static Public Member Functions

static constexpr std::string_view tag ()
 
static bool StoreTo (AchievementLinkData &val, std::string_view data)
 

Detailed Description

Member Typedef Documentation

◆ value_type

Member Function Documentation

◆ StoreTo()

bool Acore::Hyperlinks::LinkTags::achievement::StoreTo ( AchievementLinkData val,
std::string_view  data 
)
static
61{
63 uint32 achievementId;
64
65 if (!t.TryConsumeTo(achievementId))
66 return false;
67
68 val.Achievement = sAchievementMgr->GetAchievement(achievementId);
69
70 if (!(val.Achievement && t.TryConsumeTo(val.CharacterId) && t.TryConsumeTo(val.IsFinished) && t.TryConsumeTo(val.Month) && t.TryConsumeTo(val.Day)))
71 return false;
72
73 if ((12 < val.Month) || (31 < val.Day))
74 return false;
75
76 int8 year;
77
78 if (!t.TryConsumeTo(year))
79 return false;
80
81 if (val.IsFinished) // if finished, year must be >= 0
82 {
83 if (year < 0)
84 return false;
85 val.Year = static_cast<uint8>(year);
86 }
87 else
88 val.Year = 0;
89
90 return (t.TryConsumeTo(val.Criteria[0]) && t.TryConsumeTo(val.Criteria[1]) && t.TryConsumeTo(val.Criteria[2]) && t.TryConsumeTo(val.Criteria[3]) && t.IsEmpty());
91}
std::uint8_t uint8
Definition: Define.h:109
std::uint32_t uint32
Definition: Define.h:107
std::int8_t int8
Definition: Define.h:105
#define sAchievementMgr
Definition: AchievementMgr.h:451
Definition: HyperlinkTags.cpp:28

References Acore::Hyperlinks::AchievementLinkData::Achievement, Acore::Hyperlinks::AchievementLinkData::CharacterId, Acore::Hyperlinks::AchievementLinkData::Criteria, Acore::Hyperlinks::AchievementLinkData::Day, HyperlinkDataTokenizer::IsEmpty(), Acore::Hyperlinks::AchievementLinkData::IsFinished, Acore::Hyperlinks::AchievementLinkData::Month, sAchievementMgr, HyperlinkDataTokenizer::TryConsumeTo(), and Acore::Hyperlinks::AchievementLinkData::Year.

◆ tag()

static constexpr std::string_view Acore::Hyperlinks::LinkTags::achievement::tag ( )
inlinestaticconstexpr
162{ return "achievement"; }