TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SpellHistory::PersistenceHelper< Player > Struct Template Reference

Static Public Member Functions

static void SetIdentifier (PreparedStatement *stmt, uint8 index, Unit *owner)
 
static bool ReadCooldown (Field *fields, uint32 *spellId, CooldownEntry *cooldownEntry)
 
static bool ReadCharge (Field *fields, uint32 *categoryId, ChargeEntry *chargeEntry)
 
static void WriteCooldown (PreparedStatement *stmt, uint8 &index, CooldownStorageType::value_type const &cooldown)
 
static void WriteCharge (PreparedStatement *stmt, uint8 &index, uint32 chargeCategory, ChargeEntry const &charge)
 

Static Public Attributes

static
CharacterDatabaseStatements
const 
CooldownsDeleteStatement = CHAR_DEL_CHAR_SPELL_COOLDOWNS
 
static
CharacterDatabaseStatements
const 
CooldownsInsertStatement = CHAR_INS_CHAR_SPELL_COOLDOWN
 
static
CharacterDatabaseStatements
const 
ChargesDeleteStatement = CHAR_DEL_CHAR_SPELL_CHARGES
 
static
CharacterDatabaseStatements
const 
ChargesInsertStatement = CHAR_INS_CHAR_SPELL_CHARGES
 

Member Function Documentation

static bool SpellHistory::PersistenceHelper< Player >::ReadCharge ( Field fields,
uint32 categoryId,
ChargeEntry chargeEntry 
)
inlinestatic
53  {
54  *categoryId = fields[0].GetUInt32();
55  if (!sSpellCategoryStore.LookupEntry(*categoryId))
56  return false;
57 
58  chargeEntry->RechargeStart = Clock::from_time_t(time_t(fields[1].GetUInt32()));
59  chargeEntry->RechargeEnd = Clock::from_time_t(time_t(fields[2].GetUInt32()));
60  return true;
61  }
DBCStorage< SpellCategoryEntry > sSpellCategoryStore(SpellCategoryfmt)
uint32 GetUInt32() const
Definition: Field.h:146

+ Here is the call graph for this function:

static bool SpellHistory::PersistenceHelper< Player >::ReadCooldown ( Field fields,
uint32 spellId,
CooldownEntry cooldownEntry 
)
inlinestatic
39  {
40  *spellId = fields[0].GetUInt32();
41  if (!sSpellMgr->GetSpellInfo(*spellId))
42  return false;
43 
44  cooldownEntry->SpellId = *spellId;
45  cooldownEntry->CooldownEnd = Clock::from_time_t(time_t(fields[2].GetUInt32()));
46  cooldownEntry->ItemId = fields[1].GetUInt32();
47  cooldownEntry->CategoryId = fields[3].GetUInt32();
48  cooldownEntry->CategoryEnd = Clock::from_time_t(time_t(fields[4].GetUInt32()));
49  return true;
50  }
#define sSpellMgr
Definition: SpellMgr.h:756
uint32 GetUInt32() const
Definition: Field.h:146

+ Here is the call graph for this function:

static void SpellHistory::PersistenceHelper< Player >::SetIdentifier ( PreparedStatement stmt,
uint8  index,
Unit owner 
)
inlinestatic
36 { stmt->setUInt64(index, owner->GetGUID().GetCounter()); }
ObjectGuid const & GetGUID() const
Definition: Object.h:105
void setUInt64(const uint8 index, const uint64 value)
Definition: PreparedStatement.cpp:124
LowType GetCounter() const
Definition: ObjectGuid.h:221

+ Here is the call graph for this function:

static void SpellHistory::PersistenceHelper< Player >::WriteCharge ( PreparedStatement stmt,
uint8 index,
uint32  chargeCategory,
ChargeEntry const charge 
)
inlinestatic
73  {
74  stmt->setUInt32(index++, chargeCategory);
75  stmt->setUInt32(index++, uint32(Clock::to_time_t(charge.RechargeStart)));
76  stmt->setUInt32(index++, uint32(Clock::to_time_t(charge.RechargeEnd)));
77  }
void setUInt32(const uint8 index, const uint32 value)
Definition: PreparedStatement.cpp:115
uint32_t uint32
Definition: g3dmath.h:168

+ Here is the call graph for this function:

static void SpellHistory::PersistenceHelper< Player >::WriteCooldown ( PreparedStatement stmt,
uint8 index,
CooldownStorageType::value_type const cooldown 
)
inlinestatic
64  {
65  stmt->setUInt32(index++, cooldown.first);
66  stmt->setUInt32(index++, cooldown.second.ItemId);
67  stmt->setUInt32(index++, uint32(Clock::to_time_t(cooldown.second.CooldownEnd)));
68  stmt->setUInt32(index++, cooldown.second.CategoryId);
69  stmt->setUInt32(index++, uint32(Clock::to_time_t(cooldown.second.CategoryEnd)));
70  }
void setUInt32(const uint8 index, const uint32 value)
Definition: PreparedStatement.cpp:115
uint32_t uint32
Definition: g3dmath.h:168

+ Here is the call graph for this function:

Member Data Documentation


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