TrinityCore
CollectionMgr Class Reference

#include <CollectionMgr.h>

Public Types

enum class  FavoriteAppearanceState { New , Removed , Unchanged }
 

Public Member Functions

 CollectionMgr (WorldSession *owner)
 
 ~CollectionMgr ()
 
void LoadToys ()
 
void LoadAccountToys (PreparedQueryResult result)
 
void SaveAccountToys (LoginDatabaseTransaction trans)
 
void ToySetFavorite (uint32 itemId, bool favorite)
 
void ToyClearFanfare (uint32 itemId)
 
bool AddToy (uint32 itemId, bool isFavourite, bool hasFanfare)
 
bool UpdateAccountToys (uint32 itemId, bool isFavourite, bool hasFanfare)
 
bool HasToy (uint32 itemId) const
 
ToyBoxContainer const & GetAccountToys () const
 
void OnItemAdded (Item *item)
 
void LoadHeirlooms ()
 
void LoadAccountHeirlooms (PreparedQueryResult result)
 
void SaveAccountHeirlooms (LoginDatabaseTransaction trans)
 
void AddHeirloom (uint32 itemId, uint32 flags)
 
bool HasHeirloom (uint32 itemId) const
 
void UpgradeHeirloom (uint32 itemId, int32 castItem)
 
void CheckHeirloomUpgrades (Item *item)
 
bool UpdateAccountHeirlooms (uint32 itemId, uint32 flags)
 
uint32 GetHeirloomBonus (uint32 itemId) const
 
HeirloomContainer const & GetAccountHeirlooms () const
 
void LoadMounts ()
 
void LoadAccountMounts (PreparedQueryResult result)
 
void SaveAccountMounts (LoginDatabaseTransaction trans)
 
bool AddMount (uint32 spellId, MountStatusFlags flags, bool factionMount=false, bool learned=false)
 
void MountSetFavorite (uint32 spellId, bool favorite)
 
void SendSingleMountUpdate (std::pair< uint32, MountStatusFlags > mount)
 
MountContainer const & GetAccountMounts () const
 
void LoadItemAppearances ()
 
void LoadAccountItemAppearances (PreparedQueryResult knownAppearances, PreparedQueryResult favoriteAppearances)
 
void SaveAccountItemAppearances (LoginDatabaseTransaction trans)
 
void AddItemAppearance (Item *item)
 
void AddItemAppearance (uint32 itemId, uint32 appearanceModId=0)
 
void AddTransmogSet (uint32 transmogSetId)
 
bool IsSetCompleted (uint32 transmogSetId) const
 
void RemoveTemporaryAppearance (Item *item)
 
std::pair< bool, bool > HasItemAppearance (uint32 itemModifiedAppearanceId) const
 
std::unordered_set< ObjectGuidGetItemsProvidingTemporaryAppearance (uint32 itemModifiedAppearanceId) const
 
std::unordered_set< uint32GetAppearanceIds () const
 
void LoadTransmogIllusions ()
 
void LoadAccountTransmogIllusions (PreparedQueryResult knownTransmogIllusions)
 
void SaveAccountTransmogIllusions (LoginDatabaseTransaction trans)
 
void AddTransmogIllusion (uint32 transmogIllusionId)
 
bool HasTransmogIllusion (uint32 transmogIllusionId) const
 
void SetAppearanceIsFavorite (uint32 itemModifiedAppearanceId, bool apply)
 
void SendFavoriteAppearances () const
 

Static Public Member Functions

static void LoadMountDefinitions ()
 

Private Member Functions

bool CanAddAppearance (ItemModifiedAppearanceEntry const *itemModifiedAppearance) const
 
void AddItemAppearance (ItemModifiedAppearanceEntry const *itemModifiedAppearance)
 
void AddTemporaryAppearance (ObjectGuid const &itemGuid, ItemModifiedAppearanceEntry const *itemModifiedAppearance)
 

Private Attributes

WorldSession_owner
 
ToyBoxContainer _toys
 
HeirloomContainer _heirlooms
 
MountContainer _mounts
 
std::unique_ptr< boost::dynamic_bitset< uint32 > > _appearances
 
std::unordered_map< uint32, std::unordered_set< ObjectGuid > > _temporaryAppearances
 
std::unordered_map< uint32, FavoriteAppearanceState_favoriteAppearances
 
std::unique_ptr< boost::dynamic_bitset< uint32 > > _transmogIllusions
 

Detailed Description

Definition at line 82 of file CollectionMgr.h.

Member Enumeration Documentation

◆ FavoriteAppearanceState

Enumerator
New 
Removed 
Unchanged 

Definition at line 149 of file CollectionMgr.h.

Constructor & Destructor Documentation

◆ CollectionMgr()

CollectionMgr::CollectionMgr ( WorldSession owner)
explicit

Definition at line 88 of file CollectionMgr.cpp.

◆ ~CollectionMgr()

CollectionMgr::~CollectionMgr ( )

Definition at line 92 of file CollectionMgr.cpp.

Member Function Documentation

◆ AddHeirloom()

void CollectionMgr::AddHeirloom ( uint32  itemId,
uint32  flags 
)

Definition at line 237 of file CollectionMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddItemAppearance() [1/3]

void CollectionMgr::AddItemAppearance ( Item item)

Definition at line 591 of file CollectionMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddItemAppearance() [2/3]

void CollectionMgr::AddItemAppearance ( ItemModifiedAppearanceEntry const *  itemModifiedAppearance)
private

Definition at line 743 of file CollectionMgr.cpp.

+ Here is the call graph for this function:

◆ AddItemAppearance() [3/3]

void CollectionMgr::AddItemAppearance ( uint32  itemId,
uint32  appearanceModId = 0 
)

Definition at line 609 of file CollectionMgr.cpp.

+ Here is the call graph for this function:

◆ AddMount()

bool CollectionMgr::AddMount ( uint32  spellId,
MountStatusFlags  flags,
bool  factionMount = false,
bool  learned = false 
)

Definition at line 377 of file CollectionMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddTemporaryAppearance()

void CollectionMgr::AddTemporaryAppearance ( ObjectGuid const &  itemGuid,
ItemModifiedAppearanceEntry const *  itemModifiedAppearance 
)
private

Definition at line 779 of file CollectionMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddToy()

bool CollectionMgr::AddToy ( uint32  itemId,
bool  isFavourite,
bool  hasFanfare 
)

Definition at line 102 of file CollectionMgr.cpp.

+ Here is the call graph for this function:

◆ AddTransmogIllusion()

void CollectionMgr::AddTransmogIllusion ( uint32  transmogIllusionId)

Definition at line 948 of file CollectionMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddTransmogSet()

void CollectionMgr::AddTransmogSet ( uint32  transmogSetId)

Definition at line 618 of file CollectionMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CanAddAppearance()

bool CollectionMgr::CanAddAppearance ( ItemModifiedAppearanceEntry const *  itemModifiedAppearance) const
private

Definition at line 664 of file CollectionMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckHeirloomUpgrades()

void CollectionMgr::CheckHeirloomUpgrades ( Item item)

Definition at line 281 of file CollectionMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetAccountHeirlooms()

HeirloomContainer const & CollectionMgr::GetAccountHeirlooms ( ) const
inline

Definition at line 116 of file CollectionMgr.h.

+ Here is the caller graph for this function:

◆ GetAccountMounts()

MountContainer const & CollectionMgr::GetAccountMounts ( ) const
inline

Definition at line 125 of file CollectionMgr.h.

+ Here is the caller graph for this function:

◆ GetAccountToys()

ToyBoxContainer const & CollectionMgr::GetAccountToys ( ) const
inline

Definition at line 101 of file CollectionMgr.h.

+ Here is the caller graph for this function:

◆ GetAppearanceIds()

std::unordered_set< uint32 > CollectionMgr::GetAppearanceIds ( ) const

Definition at line 826 of file CollectionMgr.cpp.

+ Here is the caller graph for this function:

◆ GetHeirloomBonus()

uint32 CollectionMgr::GetHeirloomBonus ( uint32  itemId) const

Definition at line 222 of file CollectionMgr.cpp.

+ Here is the caller graph for this function:

◆ GetItemsProvidingTemporaryAppearance()

std::unordered_set< ObjectGuid > CollectionMgr::GetItemsProvidingTemporaryAppearance ( uint32  itemModifiedAppearanceId) const

Definition at line 817 of file CollectionMgr.cpp.

+ Here is the caller graph for this function:

◆ HasHeirloom()

bool CollectionMgr::HasHeirloom ( uint32  itemId) const
inline

Definition at line 110 of file CollectionMgr.h.

+ Here is the caller graph for this function:

◆ HasItemAppearance()

std::pair< bool, bool > CollectionMgr::HasItemAppearance ( uint32  itemModifiedAppearanceId) const

Definition at line 806 of file CollectionMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasToy()

bool CollectionMgr::HasToy ( uint32  itemId) const
inline

Definition at line 99 of file CollectionMgr.h.

+ Here is the caller graph for this function:

◆ HasTransmogIllusion()

bool CollectionMgr::HasTransmogIllusion ( uint32  transmogIllusionId) const

Definition at line 967 of file CollectionMgr.cpp.

◆ IsSetCompleted()

bool CollectionMgr::IsSetCompleted ( uint32  transmogSetId) const

Definition at line 634 of file CollectionMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LoadAccountHeirlooms()

void CollectionMgr::LoadAccountHeirlooms ( PreparedQueryResult  result)

Definition at line 174 of file CollectionMgr.cpp.

+ Here is the call graph for this function:

◆ LoadAccountItemAppearances()

void CollectionMgr::LoadAccountItemAppearances ( PreparedQueryResult  knownAppearances,
PreparedQueryResult  favoriteAppearances 
)

Definition at line 478 of file CollectionMgr.cpp.

+ Here is the call graph for this function:

◆ LoadAccountMounts()

void CollectionMgr::LoadAccountMounts ( PreparedQueryResult  result)

Definition at line 347 of file CollectionMgr.cpp.

+ Here is the call graph for this function:

◆ LoadAccountToys()

void CollectionMgr::LoadAccountToys ( PreparedQueryResult  result)

Definition at line 113 of file CollectionMgr.cpp.

+ Here is the call graph for this function:

◆ LoadAccountTransmogIllusions()

void CollectionMgr::LoadAccountTransmogIllusions ( PreparedQueryResult  knownTransmogIllusions)

Definition at line 890 of file CollectionMgr.cpp.

+ Here is the call graph for this function:

◆ LoadHeirlooms()

void CollectionMgr::LoadHeirlooms ( )

Definition at line 231 of file CollectionMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LoadItemAppearances()

void CollectionMgr::LoadItemAppearances ( )

Definition at line 466 of file CollectionMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LoadMountDefinitions()

void CollectionMgr::LoadMountDefinitions ( )
static

Definition at line 36 of file CollectionMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LoadMounts()

void CollectionMgr::LoadMounts ( )

Definition at line 341 of file CollectionMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LoadToys()

void CollectionMgr::LoadToys ( )

Definition at line 96 of file CollectionMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LoadTransmogIllusions()

void CollectionMgr::LoadTransmogIllusions ( )

Definition at line 881 of file CollectionMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MountSetFavorite()

void CollectionMgr::MountSetFavorite ( uint32  spellId,
bool  favorite 
)

Definition at line 412 of file CollectionMgr.cpp.

+ Here is the call graph for this function:

◆ OnItemAdded()

void CollectionMgr::OnItemAdded ( Item item)

Definition at line 166 of file CollectionMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RemoveTemporaryAppearance()

void CollectionMgr::RemoveTemporaryAppearance ( Item item)

Definition at line 788 of file CollectionMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SaveAccountHeirlooms()

void CollectionMgr::SaveAccountHeirlooms ( LoginDatabaseTransaction  trans)

Definition at line 204 of file CollectionMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SaveAccountItemAppearances()

void CollectionMgr::SaveAccountItemAppearances ( LoginDatabaseTransaction  trans)

Definition at line 531 of file CollectionMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SaveAccountMounts()

void CollectionMgr::SaveAccountMounts ( LoginDatabaseTransaction  trans)

Definition at line 365 of file CollectionMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SaveAccountToys()

void CollectionMgr::SaveAccountToys ( LoginDatabaseTransaction  trans)

Definition at line 126 of file CollectionMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SaveAccountTransmogIllusions()

void CollectionMgr::SaveAccountTransmogIllusions ( LoginDatabaseTransaction  trans)

Definition at line 930 of file CollectionMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendFavoriteAppearances()

void CollectionMgr::SendFavoriteAppearances ( ) const

Definition at line 869 of file CollectionMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendSingleMountUpdate()

void CollectionMgr::SendSingleMountUpdate ( std::pair< uint32, MountStatusFlags mount)

Definition at line 426 of file CollectionMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetAppearanceIsFavorite()

void CollectionMgr::SetAppearanceIsFavorite ( uint32  itemModifiedAppearanceId,
bool  apply 
)

Definition at line 839 of file CollectionMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ToyClearFanfare()

void CollectionMgr::ToyClearFanfare ( uint32  itemId)

Definition at line 157 of file CollectionMgr.cpp.

◆ ToySetFavorite()

void CollectionMgr::ToySetFavorite ( uint32  itemId,
bool  favorite 
)

Definition at line 145 of file CollectionMgr.cpp.

+ Here is the caller graph for this function:

◆ UpdateAccountHeirlooms()

bool CollectionMgr::UpdateAccountHeirlooms ( uint32  itemId,
uint32  flags 
)

Definition at line 217 of file CollectionMgr.cpp.

+ Here is the caller graph for this function:

◆ UpdateAccountToys()

bool CollectionMgr::UpdateAccountToys ( uint32  itemId,
bool  isFavourite,
bool  hasFanfare 
)

Definition at line 140 of file CollectionMgr.cpp.

+ Here is the caller graph for this function:

◆ UpgradeHeirloom()

void CollectionMgr::UpgradeHeirloom ( uint32  itemId,
int32  castItem 
)

Definition at line 243 of file CollectionMgr.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ _appearances

std::unique_ptr<boost::dynamic_bitset<uint32> > CollectionMgr::_appearances
private

Definition at line 169 of file CollectionMgr.h.

◆ _favoriteAppearances

std::unordered_map<uint32, FavoriteAppearanceState> CollectionMgr::_favoriteAppearances
private

Definition at line 171 of file CollectionMgr.h.

◆ _heirlooms

HeirloomContainer CollectionMgr::_heirlooms
private

Definition at line 167 of file CollectionMgr.h.

◆ _mounts

MountContainer CollectionMgr::_mounts
private

Definition at line 168 of file CollectionMgr.h.

◆ _owner

WorldSession* CollectionMgr::_owner
private

Definition at line 164 of file CollectionMgr.h.

◆ _temporaryAppearances

std::unordered_map<uint32, std::unordered_set<ObjectGuid> > CollectionMgr::_temporaryAppearances
private

Definition at line 170 of file CollectionMgr.h.

◆ _toys

ToyBoxContainer CollectionMgr::_toys
private

Definition at line 166 of file CollectionMgr.h.

◆ _transmogIllusions

std::unique_ptr<boost::dynamic_bitset<uint32> > CollectionMgr::_transmogIllusions
private

Definition at line 172 of file CollectionMgr.h.


The documentation for this class was generated from the following files: