TrinityCore
BattlePets::BattlePetMgr Class Reference

#include <BattlePetMgr.h>

Public Member Functions

 BattlePetMgr (WorldSession *owner)
 
 BattlePetMgr (BattlePetMgr const &right)=delete
 
 BattlePetMgr (BattlePetMgr &&right)=delete
 
void LoadFromDB (PreparedQueryResult pets, PreparedQueryResult slots)
 
void SaveToDB (LoginDatabaseTransaction trans)
 
BattlePetGetPet (ObjectGuid guid)
 
void AddPet (uint32 species, uint32 display, uint16 breed, BattlePetBreedQuality quality, uint16 level=1)
 
void RemovePet (ObjectGuid guid)
 
void ClearFanfare (ObjectGuid guid)
 
void ModifyName (ObjectGuid guid, std::string const &name, std::unique_ptr< DeclinedName > declinedName)
 
bool IsPetInSlot (ObjectGuid guid)
 
uint8 GetPetCount (BattlePetSpeciesEntry const *battlePetSpecies, ObjectGuid ownerGuid) const
 
bool HasMaxPetCount (BattlePetSpeciesEntry const *battlePetSpecies, ObjectGuid ownerGuid) const
 
uint32 GetPetUniqueSpeciesCount () const
 
WorldPackets::BattlePet::BattlePetSlotGetSlot (BattlePetSlot slot)
 
void UnlockSlot (BattlePetSlot slot)
 
WorldSessionGetOwner () const
 
uint16 GetTrapLevel () const
 
uint16 GetMaxPetLevel () const
 
std::vector< WorldPackets::BattlePet::BattlePetSlot > const & GetSlots () const
 
void CageBattlePet (ObjectGuid guid)
 
void ChangeBattlePetQuality (ObjectGuid guid, BattlePetBreedQuality quality)
 
void GrantBattlePetExperience (ObjectGuid guid, uint16 xp, BattlePetXpSource xpSource)
 
void GrantBattlePetLevel (ObjectGuid guid, uint16 grantedLevels)
 
void HealBattlePetsPct (uint8 pct)
 
void UpdateBattlePetData (ObjectGuid guid)
 
void SummonPet (ObjectGuid guid)
 
void DismissPet ()
 
void SendJournal ()
 
void SendUpdates (std::vector< std::reference_wrapper< BattlePet > > pets, bool petAdded)
 
void SendError (BattlePetError error, uint32 creatureId)
 
void SendJournalLockStatus ()
 
bool IsJournalLockAcquired () const
 
bool HasJournalLock () const
 
void ToggleJournalLock (bool lock)
 
bool IsBattlePetSystemEnabled ()
 

Static Public Member Functions

static void Initialize ()
 
static void AddBattlePetSpeciesBySpell (uint32 spellId, BattlePetSpeciesEntry const *speciesEntry)
 
static BattlePetSpeciesEntry const * GetBattlePetSpeciesByCreature (uint32 creatureId)
 
static BattlePetSpeciesEntry const * GetBattlePetSpeciesBySpell (uint32 spellId)
 
static uint16 RollPetBreed (uint32 species)
 
static BattlePetBreedQuality GetDefaultPetQuality (uint32 species)
 
static uint32 SelectPetDisplay (BattlePetSpeciesEntry const *speciesEntry)
 

Static Private Member Functions

static void LoadAvailablePetBreeds ()
 
static void LoadDefaultPetQualities ()
 

Private Attributes

WorldSession_owner
 
bool _hasJournalLock = false
 
uint16 _trapLevel = 0
 
std::unordered_map< uint64, BattlePet_pets
 
std::vector< WorldPackets::BattlePet::BattlePetSlot_slots
 

Detailed Description

Definition at line 146 of file BattlePetMgr.h.

Constructor & Destructor Documentation

◆ BattlePetMgr() [1/3]

BattlePets::BattlePetMgr::BattlePetMgr ( WorldSession owner)
explicit

Definition at line 229 of file BattlePetMgr.cpp.

+ Here is the call graph for this function:

◆ BattlePetMgr() [2/3]

BattlePets::BattlePetMgr::BattlePetMgr ( BattlePetMgr const &  right)
delete

◆ BattlePetMgr() [3/3]

BattlePets::BattlePetMgr::BattlePetMgr ( BattlePetMgr &&  right)
delete

Member Function Documentation

◆ AddBattlePetSpeciesBySpell()

void BattlePets::BattlePetMgr::AddBattlePetSpeciesBySpell ( uint32  spellId,
BattlePetSpeciesEntry const *  speciesEntry 
)
static

Definition at line 186 of file BattlePetMgr.cpp.

+ Here is the caller graph for this function:

◆ AddPet()

void BattlePets::BattlePetMgr::AddPet ( uint32  species,
uint32  display,
uint16  breed,
BattlePetBreedQuality  quality,
uint16  level = 1 
)

Definition at line 449 of file BattlePetMgr.cpp.

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

◆ CageBattlePet()

void BattlePets::BattlePetMgr::CageBattlePet ( ObjectGuid  guid)

Definition at line 612 of file BattlePetMgr.cpp.

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

◆ ChangeBattlePetQuality()

void BattlePets::BattlePetMgr::ChangeBattlePetQuality ( ObjectGuid  guid,
BattlePetBreedQuality  quality 
)

Definition at line 665 of file BattlePetMgr.cpp.

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

◆ ClearFanfare()

void BattlePets::BattlePetMgr::ClearFanfare ( ObjectGuid  guid)

Definition at line 504 of file BattlePetMgr.cpp.

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

◆ DismissPet()

void BattlePets::BattlePetMgr::DismissPet ( )

Definition at line 861 of file BattlePetMgr.cpp.

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

◆ GetBattlePetSpeciesByCreature()

BattlePetSpeciesEntry const * BattlePets::BattlePetMgr::GetBattlePetSpeciesByCreature ( uint32  creatureId)
static

Definition at line 191 of file BattlePetMgr.cpp.

+ Here is the call graph for this function:

◆ GetBattlePetSpeciesBySpell()

BattlePetSpeciesEntry const * BattlePets::BattlePetMgr::GetBattlePetSpeciesBySpell ( uint32  spellId)
static

Definition at line 196 of file BattlePetMgr.cpp.

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

◆ GetDefaultPetQuality()

BattlePetBreedQuality BattlePets::BattlePetMgr::GetDefaultPetQuality ( uint32  species)
static

Definition at line 210 of file BattlePetMgr.cpp.

+ Here is the caller graph for this function:

◆ GetMaxPetLevel()

uint16 BattlePets::BattlePetMgr::GetMaxPetLevel ( ) const

Definition at line 602 of file BattlePetMgr.cpp.

+ Here is the caller graph for this function:

◆ GetOwner()

WorldSession * BattlePets::BattlePetMgr::GetOwner ( ) const
inline

Definition at line 179 of file BattlePetMgr.h.

◆ GetPet()

BattlePet * BattlePets::BattlePetMgr::GetPet ( ObjectGuid  guid)

Definition at line 444 of file BattlePetMgr.cpp.

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

◆ GetPetCount()

uint8 BattlePets::BattlePetMgr::GetPetCount ( BattlePetSpeciesEntry const *  battlePetSpecies,
ObjectGuid  ownerGuid 
) const

Definition at line 548 of file BattlePetMgr.cpp.

+ Here is the caller graph for this function:

◆ GetPetUniqueSpeciesCount()

uint32 BattlePets::BattlePetMgr::GetPetUniqueSpeciesCount ( ) const

Definition at line 574 of file BattlePetMgr.cpp.

+ Here is the caller graph for this function:

◆ GetSlot()

WorldPackets::BattlePet::BattlePetSlot * BattlePets::BattlePetMgr::GetSlot ( BattlePetSlot  slot)
inline

Definition at line 176 of file BattlePetMgr.h.

◆ GetSlots()

std::vector< WorldPackets::BattlePet::BattlePetSlot > const & BattlePets::BattlePetMgr::GetSlots ( ) const
inline

Definition at line 183 of file BattlePetMgr.h.

+ Here is the caller graph for this function:

◆ GetTrapLevel()

uint16 BattlePets::BattlePetMgr::GetTrapLevel ( ) const
inline

Definition at line 181 of file BattlePetMgr.h.

◆ GrantBattlePetExperience()

void BattlePets::BattlePetMgr::GrantBattlePetExperience ( ObjectGuid  guid,
uint16  xp,
BattlePetXpSource  xpSource 
)

Definition at line 700 of file BattlePetMgr.cpp.

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

◆ GrantBattlePetLevel()

void BattlePets::BattlePetMgr::GrantBattlePetLevel ( ObjectGuid  guid,
uint16  grantedLevels 
)

Definition at line 760 of file BattlePetMgr.cpp.

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

◆ HasJournalLock()

bool BattlePets::BattlePetMgr::HasJournalLock ( ) const
inline

Definition at line 201 of file BattlePetMgr.h.

+ Here is the caller graph for this function:

◆ HasMaxPetCount()

bool BattlePets::BattlePetMgr::HasMaxPetCount ( BattlePetSpeciesEntry const *  battlePetSpecies,
ObjectGuid  ownerGuid 
) const

Definition at line 567 of file BattlePetMgr.cpp.

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

◆ HealBattlePetsPct()

void BattlePets::BattlePetMgr::HealBattlePetsPct ( uint8  pct)

Definition at line 799 of file BattlePetMgr.cpp.

+ Here is the call graph for this function:

◆ Initialize()

void BattlePets::BattlePetMgr::Initialize ( )
static

Definition at line 96 of file BattlePetMgr.cpp.

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

◆ IsBattlePetSystemEnabled()

bool BattlePets::BattlePetMgr::IsBattlePetSystemEnabled ( )
inline

Definition at line 204 of file BattlePetMgr.h.

+ Here is the caller graph for this function:

◆ IsJournalLockAcquired()

bool BattlePets::BattlePetMgr::IsJournalLockAcquired ( ) const

Definition at line 925 of file BattlePetMgr.cpp.

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

◆ IsPetInSlot()

bool BattlePets::BattlePetMgr::IsPetInSlot ( ObjectGuid  guid)

Definition at line 539 of file BattlePetMgr.cpp.

+ Here is the caller graph for this function:

◆ LoadAvailablePetBreeds()

void BattlePets::BattlePetMgr::LoadAvailablePetBreeds ( )
staticprivate

Definition at line 115 of file BattlePetMgr.cpp.

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

◆ LoadDefaultPetQualities()

void BattlePets::BattlePetMgr::LoadDefaultPetQualities ( )
staticprivate

Definition at line 146 of file BattlePetMgr.cpp.

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

◆ LoadFromDB()

void BattlePets::BattlePetMgr::LoadFromDB ( PreparedQueryResult  pets,
PreparedQueryResult  slots 
)

Definition at line 240 of file BattlePetMgr.cpp.

+ Here is the call graph for this function:

◆ ModifyName()

void BattlePets::BattlePetMgr::ModifyName ( ObjectGuid  guid,
std::string const &  name,
std::unique_ptr< DeclinedName declinedName 
)

Definition at line 516 of file BattlePetMgr.cpp.

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

◆ RemovePet()

void BattlePets::BattlePetMgr::RemovePet ( ObjectGuid  guid)

Definition at line 492 of file BattlePetMgr.cpp.

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

◆ RollPetBreed()

uint16 BattlePets::BattlePetMgr::RollPetBreed ( uint32  species)
static

Definition at line 201 of file BattlePetMgr.cpp.

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

◆ SaveToDB()

void BattlePets::BattlePetMgr::SaveToDB ( LoginDatabaseTransaction  trans)

Definition at line 331 of file BattlePetMgr.cpp.

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

◆ SelectPetDisplay()

uint32 BattlePets::BattlePetMgr::SelectPetDisplay ( BattlePetSpeciesEntry const *  speciesEntry)
static

Definition at line 219 of file BattlePetMgr.cpp.

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

◆ SendError()

void BattlePets::BattlePetMgr::SendError ( BattlePetError  error,
uint32  creatureId 
)

Definition at line 900 of file BattlePetMgr.cpp.

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

◆ SendJournal()

void BattlePets::BattlePetMgr::SendJournal ( )

Definition at line 871 of file BattlePetMgr.cpp.

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

◆ SendJournalLockStatus()

void BattlePets::BattlePetMgr::SendJournalLockStatus ( )

Definition at line 908 of file BattlePetMgr.cpp.

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

◆ SendUpdates()

void BattlePets::BattlePetMgr::SendUpdates ( std::vector< std::reference_wrapper< BattlePet > >  pets,
bool  petAdded 
)

Definition at line 890 of file BattlePetMgr.cpp.

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

◆ SummonPet()

void BattlePets::BattlePetMgr::SummonPet ( ObjectGuid  guid)

Definition at line 838 of file BattlePetMgr.cpp.

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

◆ ToggleJournalLock()

void BattlePets::BattlePetMgr::ToggleJournalLock ( bool  lock)
inline

Definition at line 202 of file BattlePetMgr.h.

+ Here is the caller graph for this function:

◆ UnlockSlot()

void BattlePets::BattlePetMgr::UnlockSlot ( BattlePetSlot  slot)

Definition at line 584 of file BattlePetMgr.cpp.

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

◆ UpdateBattlePetData()

void BattlePets::BattlePetMgr::UpdateBattlePetData ( ObjectGuid  guid)

Definition at line 819 of file BattlePetMgr.cpp.

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

Member Data Documentation

◆ _hasJournalLock

bool BattlePets::BattlePetMgr::_hasJournalLock = false
private

Definition at line 208 of file BattlePetMgr.h.

◆ _owner

WorldSession* BattlePets::BattlePetMgr::_owner
private

Definition at line 207 of file BattlePetMgr.h.

◆ _pets

std::unordered_map<uint64 , BattlePet> BattlePets::BattlePetMgr::_pets
private

Definition at line 210 of file BattlePetMgr.h.

◆ _slots

std::vector<WorldPackets::BattlePet::BattlePetSlot> BattlePets::BattlePetMgr::_slots
private

Definition at line 211 of file BattlePetMgr.h.

◆ _trapLevel

uint16 BattlePets::BattlePetMgr::_trapLevel = 0
private

Definition at line 209 of file BattlePetMgr.h.


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