Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
BattlePet Class Reference

#include <BattlePet.h>

Public Member Functions

uint16 AddExperience (uint16 xp)
 BattlePet (uint64 id, uint16 speciesId, std::string nickname, uint32 timestamp, uint8 level, uint16 xp, uint16 curHealth, uint16 maxHealth, uint16 power, uint16 speed, uint8 quality, uint8 breedId, uint16 flags)
 BattlePet (uint64 id, uint16 speciesId, uint8 level, uint8 quality, uint8 breedId)
void CalculateStats (bool currentHealth=false)
uint8 GetBreed () const
uint16 GetCurrentHealth () const
BattlePetDbState GetDbState () const
uint16 GetFlags () const
uint64 GetId () const
uint8 GetLevel () const
uint16 GetMaxHealth () const
std::string GetNickname () const
uint16 GetPower () const
uint8 GetQuality () const
uint16 GetSpecies () const
uint16 GetSpeed () const
uint32 GetTimestamp () const
uint16 GetXp () const
bool HasFlag (uint16 flag) const
void SetCurrentHealth (uint16 health)
void SetDbState (BattlePetDbState state)
void SetFlag (uint16 flag)
void SetLevel (uint8 level)
void SetNickname (std::string const &nickname)
void SetQuality (ItemQualities quality)
void SetTimestamp (uint32 timestamp)
void SetXp (uint16 xp)
void UnSetFlag (uint16 flag)

Private Attributes

uint8 m_breed
uint16 m_curHealth
BattlePetDbState m_dbState
uint16 m_flags
uint64 m_id
uint8 m_level
uint16 m_maxHealth
std::string m_nickname
uint16 m_power
uint8 m_quality
uint16 m_species
uint16 m_speed
uint32 m_timestamp
uint16 m_xp

Detailed Description

Definition at line 200 of file BattlePet.h.

Constructor & Destructor Documentation

◆ BattlePet() [1/2]

BattlePet::BattlePet ( uint64 id,
uint16 speciesId,
std::string nickname,
uint32 timestamp,
uint8 level,
uint16 xp,
uint16 curHealth,
uint16 maxHealth,
uint16 power,
uint16 speed,
uint8 quality,
uint8 breedId,
uint16 flags )
inline

◆ BattlePet() [2/2]

BattlePet::BattlePet ( uint64 id,
uint16 speciesId,
uint8 level,
uint8 quality,
uint8 breedId )
inline

Member Function Documentation

◆ AddExperience()

uint16 BattlePet::AddExperience ( uint16 xp)

◆ CalculateStats()

◆ GetBreed()

uint8 BattlePet::GetBreed ( ) const
inline

◆ GetCurrentHealth()

◆ GetDbState()

◆ GetFlags()

◆ GetId()

◆ GetLevel()

◆ GetMaxHealth()

◆ GetNickname()

◆ GetPower()

◆ GetQuality()

◆ GetSpecies()

◆ GetSpeed()

◆ GetTimestamp()

uint32 BattlePet::GetTimestamp ( ) const
inline

◆ GetXp()

◆ HasFlag()

bool BattlePet::HasFlag ( uint16 flag) const
inline

Definition at line 238 of file BattlePet.h.

References m_flags.

Referenced by SetFlag(), and UnSetFlag().

◆ SetCurrentHealth()

◆ SetDbState()

void BattlePet::SetDbState ( BattlePetDbState state)
inline

Definition at line 235 of file BattlePet.h.

References m_dbState.

Referenced by BattlePetMgr::Delete(), and BattlePetMgr::SaveToDb().

◆ SetFlag()

void BattlePet::SetFlag ( uint16 flag)

Definition at line 394 of file BattlePet.cpp.

References BATTLE_PET_DB_STATE_SAVE, HasFlag(), m_dbState, and m_flags.

Referenced by WorldSession::HandleBattlePetSetFlags().

◆ SetLevel()

void BattlePet::SetLevel ( uint8 level)

◆ SetNickname()

void BattlePet::SetNickname ( std::string const & nickname)

Definition at line 354 of file BattlePet.cpp.

References BATTLE_PET_DB_STATE_SAVE, m_dbState, and m_nickname.

Referenced by WorldSession::HandleBattlePetModifyName().

◆ SetQuality()

void BattlePet::SetQuality ( ItemQualities quality)

Definition at line 369 of file BattlePet.cpp.

References CalculateStats(), and m_quality.

◆ SetTimestamp()

void BattlePet::SetTimestamp ( uint32 timestamp)

Definition at line 360 of file BattlePet.cpp.

References BATTLE_PET_DB_STATE_SAVE, m_dbState, and m_timestamp.

Referenced by WorldSession::HandleBattlePetModifyName().

◆ SetXp()

void BattlePet::SetXp ( uint16 xp)

◆ UnSetFlag()

void BattlePet::UnSetFlag ( uint16 flag)

Definition at line 403 of file BattlePet.cpp.

References BATTLE_PET_DB_STATE_SAVE, HasFlag(), m_dbState, and m_flags.

Referenced by WorldSession::HandleBattlePetSetFlags().

Member Data Documentation

◆ m_breed

uint8 BattlePet::m_breed
private

Definition at line 258 of file BattlePet.h.

Referenced by BattlePet(), BattlePet(), CalculateStats(), and GetBreed().

◆ m_curHealth

uint16 BattlePet::m_curHealth
private

Definition at line 253 of file BattlePet.h.

Referenced by BattlePet(), BattlePet(), CalculateStats(), GetCurrentHealth(), and SetCurrentHealth().

◆ m_dbState

◆ m_flags

uint16 BattlePet::m_flags
private

Definition at line 259 of file BattlePet.h.

Referenced by BattlePet(), BattlePet(), GetFlags(), HasFlag(), SetFlag(), and UnSetFlag().

◆ m_id

uint64 BattlePet::m_id
private

Definition at line 247 of file BattlePet.h.

Referenced by BattlePet(), BattlePet(), and GetId().

◆ m_level

uint8 BattlePet::m_level
private

Definition at line 251 of file BattlePet.h.

Referenced by AddExperience(), BattlePet(), BattlePet(), CalculateStats(), GetLevel(), and SetLevel().

◆ m_maxHealth

uint16 BattlePet::m_maxHealth
private

Definition at line 254 of file BattlePet.h.

Referenced by BattlePet(), BattlePet(), CalculateStats(), GetMaxHealth(), and SetCurrentHealth().

◆ m_nickname

std::string BattlePet::m_nickname
private

Definition at line 249 of file BattlePet.h.

Referenced by BattlePet(), BattlePet(), GetNickname(), and SetNickname().

◆ m_power

uint16 BattlePet::m_power
private

Definition at line 255 of file BattlePet.h.

Referenced by BattlePet(), BattlePet(), CalculateStats(), and GetPower().

◆ m_quality

uint8 BattlePet::m_quality
private

Definition at line 257 of file BattlePet.h.

Referenced by BattlePet(), BattlePet(), CalculateStats(), GetQuality(), and SetQuality().

◆ m_species

uint16 BattlePet::m_species
private

Definition at line 248 of file BattlePet.h.

Referenced by BattlePet(), BattlePet(), CalculateStats(), and GetSpecies().

◆ m_speed

uint16 BattlePet::m_speed
private

Definition at line 256 of file BattlePet.h.

Referenced by BattlePet(), BattlePet(), CalculateStats(), and GetSpeed().

◆ m_timestamp

uint32 BattlePet::m_timestamp
private

Definition at line 250 of file BattlePet.h.

Referenced by BattlePet(), BattlePet(), GetTimestamp(), and SetTimestamp().

◆ m_xp

uint16 BattlePet::m_xp
private

Definition at line 252 of file BattlePet.h.

Referenced by AddExperience(), BattlePet(), BattlePet(), GetXp(), and SetXp().


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