AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
SpellHistory::PersistenceHelper< Player > Struct Reference

Static Public Member Functions

static void SetIdentifier (PreparedStatementBase *stmt, uint8 index, Unit *owner)
 
static bool ReadCooldown (Field *fields, uint32 *spellId, CooldownEntry *cooldownEntry)
 
static void WriteCooldown (PreparedStatementBase *stmt, uint8 &index, CooldownStorageType::value_type const &cooldown)
 

Static Public Attributes

static CharacterDatabaseStatements const CooldownsDeleteStatement = CHAR_DEL_CHAR_SPELL_COOLDOWN
 
static CharacterDatabaseStatements const CooldownsInsertStatement = CHAR_INS_CHAR_SPELL_COOLDOWN
 

Detailed Description

Member Function Documentation

◆ ReadCooldown()

static bool SpellHistory::PersistenceHelper< Player >::ReadCooldown ( Field *  fields,
uint32 *  spellId,
CooldownEntry *  cooldownEntry 
)
inlinestatic
42 {
43 *spellId = fields[0].Get<uint32>();
44 if (!sSpellMgr->GetSpellInfo(*spellId))
45 return false;
46
47 cooldownEntry->SpellId = *spellId;
48 cooldownEntry->CooldownEnd = Clock::from_time_t(time_t(fields[2].Get<uint32>()));
49 cooldownEntry->ItemId = fields[1].Get<uint32>();
50 cooldownEntry->CategoryId = fields[3].Get<uint32>();
51 cooldownEntry->CategoryEnd = Clock::from_time_t(time_t(fields[4].Get<uint32>()));
52 return true;
53 }
std::uint32_t uint32
Definition Define.h:107
#define sSpellMgr
Definition SpellMgr.h:851
std::enable_if_t< std::is_arithmetic_v< T >, T > Get() const
Definition Field.h:113

References SpellHistory::CooldownEntry::CategoryEnd, SpellHistory::CooldownEntry::CategoryId, SpellHistory::CooldownEntry::CooldownEnd, Field::Get(), SpellHistory::CooldownEntry::ItemId, SpellHistory::CooldownEntry::SpellId, and sSpellMgr.

◆ SetIdentifier()

static void SpellHistory::PersistenceHelper< Player >::SetIdentifier ( PreparedStatementBase *  stmt,
uint8  index,
Unit *  owner 
)
inlinestatic
39{ stmt->SetData(index, owner->GetGUID().GetCounter()); }
LowType GetCounter() const
Definition ObjectGuid.h:149
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:120
Acore::Types::is_default< T > SetData(const uint8 index, T value)
Definition PreparedStatement.h:77

References ObjectGuid::GetCounter(), Object::GetGUID(), and PreparedStatementBase::SetData().

◆ WriteCooldown()

static void SpellHistory::PersistenceHelper< Player >::WriteCooldown ( PreparedStatementBase *  stmt,
uint8 &  index,
CooldownStorageType::value_type const &  cooldown 
)
inlinestatic
56 {
57 stmt->SetData(index++, cooldown.first);
58 stmt->SetData(index++, cooldown.second.ItemId);
59 stmt->SetData(index++, uint32(Clock::to_time_t(cooldown.second.CooldownEnd)));
60 stmt->SetData(index++, cooldown.second.CategoryId);
61 stmt->SetData(index++, uint32(Clock::to_time_t(cooldown.second.CategoryEnd)));
62 }

References PreparedStatementBase::SetData().

Member Data Documentation

◆ CooldownsDeleteStatement

◆ CooldownsInsertStatement


The documentation for this struct was generated from the following file: