TrinityCore
Loading...
Searching...
No Matches
BaseEntity Class Referenceabstract

#include <BaseEntity.h>

+ Inheritance diagram for BaseEntity:

Public Member Functions

virtual ~BaseEntity ()
 
bool IsInWorld () const
 
virtual void AddToWorld ()
 
virtual void RemoveFromWorld ()
 
ObjectGuid const & GetGUID () const
 
TypeID GetTypeId () const
 
bool isType (TypeMask mask) const
 
bool IsWorldObject () const
 
bool IsItem () const
 
bool IsUnit () const
 
bool IsCreature () const
 
bool IsPlayer () const
 
bool IsGameObject () const
 
bool IsDynObject () const
 
bool IsCorpse () const
 
bool IsAreaTrigger () const
 
bool IsSceneObject () const
 
bool IsConversation () const
 
bool IsMeshObject () const
 
virtual void BuildCreateUpdateBlockForPlayer (UpdateData *data, Player *target) const
 
void SendUpdateToPlayer (Player *player) const
 
void BuildValuesUpdateBlockForPlayer (UpdateData *data, Player const *target) const
 
void BuildDestroyUpdateBlock (UpdateData *data) const
 
void BuildOutOfRangeUpdateBlock (UpdateData *data) const
 
ByteBufferPrepareValuesUpdateBuffer (UpdateData *data) const
 
virtual void DestroyForPlayer (Player const *target) const
 
void SendOutOfRangeForPlayer (Player const *target) const
 
void ClearUpdateMask (bool remove)
 
virtual std::string GetNameForLocaleIdx (LocaleConstant locale) const =0
 
void SetIsNewObject (bool enable)
 
bool IsDestroyedObject () const
 
void SetDestroyedObject (bool destroyed)
 
virtual void BuildUpdate (UpdateDataMapType &data_map)
 
void BuildUpdateChangesMask ()
 
void BuildFieldsUpdate (Player *player, UpdateDataMapType &data_map) const
 
template<typename T >
void ForceUpdateFieldChange (UF::UpdateFieldPrivateSetter< T > const &)
 
virtual std::string GetDebugInfo () const
 

Static Public Member Functions

static ObjectGuid GetGUID (BaseEntity const *o)
 

Public Attributes

UF::UpdateFieldHolder m_values
 

Protected Member Functions

 BaseEntity ()
 
void _Create (ObjectGuid const &guid)
 
template<typename T >
void SetUpdateFieldValue (UF::UpdateFieldPrivateSetter< T > setter, typename UF::UpdateFieldPrivateSetter< T >::value_type value)
 
template<typename T >
void SetUpdateFieldFlagValue (UF::UpdateFieldPrivateSetter< T > setter, typename UF::UpdateFieldPrivateSetter< T >::value_type flag)
 
template<typename T >
void RemoveUpdateFieldFlagValue (UF::UpdateFieldPrivateSetter< T > setter, typename UF::UpdateFieldPrivateSetter< T >::value_type flag)
 
template<typename T >
UF::DynamicUpdateFieldSetter< T >::insert_result AddDynamicUpdateFieldValue (UF::DynamicUpdateFieldSetter< T > setter)
 
template<typename T >
UF::DynamicUpdateFieldSetter< T >::insert_result InsertDynamicUpdateFieldValue (UF::DynamicUpdateFieldSetter< T > setter, uint32 index)
 
template<typename T >
void RemoveDynamicUpdateFieldValue (UF::DynamicUpdateFieldSetter< T > setter, uint32 index)
 
template<typename T >
void ClearDynamicUpdateFieldValues (UF::DynamicUpdateFieldSetter< T > setter)
 
template<typename K , typename V >
void RemoveMapUpdateFieldValue (UF::MapUpdateFieldSetter< K, V > setter, std::type_identity_t< K > const &key)
 
template<typename T >
void InsertSetUpdateFieldValue (UF::SetUpdateFieldSetter< T > setter, std::type_identity_t< T > const &key)
 
template<typename T >
void RemoveSetUpdateFieldValue (UF::SetUpdateFieldSetter< T > setter, std::type_identity_t< T > const &key)
 
template<typename T >
void RemoveOptionalUpdateFieldValue (UF::OptionalUpdateFieldSetter< T > setter)
 
template<typename T >
void SetUpdateFieldStatValue (UF::UpdateFieldPrivateSetter< T > setter, typename UF::UpdateFieldPrivateSetter< T >::value_type value)
 
template<typename T >
void ApplyModUpdateFieldValue (UF::UpdateFieldPrivateSetter< T > setter, typename UF::UpdateFieldPrivateSetter< T >::value_type mod, bool apply)
 
template<typename T >
void ApplyPercentModUpdateFieldValue (UF::UpdateFieldPrivateSetter< T > setter, float percent, bool apply)
 
template<typename Action >
void DoWithSuppressingObjectUpdates (Action &&action)
 
void BuildMovementUpdate (ByteBuffer &data, CreateObjectBits flags, Player const *target) const
 
virtual UF::UpdateFieldFlag GetUpdateFieldFlagsFor (Player const *target) const
 
virtual bool AddToObjectUpdate ()=0
 
virtual void RemoveFromObjectUpdate ()=0
 
void AddToObjectUpdateIfNeeded ()
 

Static Protected Member Functions

static void BuildEntityFragments (ByteBuffer &data, std::span< WowCS::EntityFragment const > fragments)
 

Protected Attributes

TypeID m_objectTypeId = NUM_CLIENT_OBJECT_TYPES
 
CreateObjectBits m_updateFlag = {}
 
WowCS::EntityFragmentsHolder m_entityFragments
 
bool m_objectUpdated = false
 

Private Member Functions

 BaseEntity (BaseEntity const &right)=delete
 
 BaseEntity (BaseEntity &&right)=delete
 
BaseEntityoperator= (BaseEntity const &right)=delete
 
BaseEntityoperator= (BaseEntity &&right)=delete
 

Private Attributes

ObjectGuid m_guid
 
bool m_inWorld = false
 
bool m_isNewObject = false
 
bool m_isDestroyedObject = false
 

Detailed Description

Definition at line 151 of file BaseEntity.h.

Constructor & Destructor Documentation

◆ ~BaseEntity()

BaseEntity::~BaseEntity ( )
virtual

Definition at line 56 of file BaseEntity.cpp.

+ Here is the call graph for this function:

◆ BaseEntity() [1/3]

BaseEntity::BaseEntity ( )
protecteddefault

◆ BaseEntity() [2/3]

BaseEntity::BaseEntity ( BaseEntity const &  right)
privatedelete

◆ BaseEntity() [3/3]

BaseEntity::BaseEntity ( BaseEntity &&  right)
privatedelete

Member Function Documentation

◆ _Create()

void BaseEntity::_Create ( ObjectGuid const &  guid)
inlineprotected

Definition at line 218 of file BaseEntity.h.

+ Here is the caller graph for this function:

◆ AddDynamicUpdateFieldValue()

template<typename T >
UF::DynamicUpdateFieldSetter< T >::insert_result BaseEntity::AddDynamicUpdateFieldValue ( UF::DynamicUpdateFieldSetter< T >  setter)
inlineprotected

Definition at line 242 of file BaseEntity.h.

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

◆ AddToObjectUpdate()

virtual bool BaseEntity::AddToObjectUpdate ( )
protectedpure virtual

Implemented in Battlenet::Account, Item, and WorldObject.

+ Here is the caller graph for this function:

◆ AddToObjectUpdateIfNeeded()

void BaseEntity::AddToObjectUpdateIfNeeded ( )
protected

Definition at line 662 of file BaseEntity.cpp.

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

◆ AddToWorld()

void BaseEntity::AddToWorld ( )
virtual

Reimplemented in AreaTrigger, Conversation, Corpse, Creature, DynamicObject, GameObject, Bag, Object, WorldObject, Pet, Player, SceneObject, and Unit.

Definition at line 71 of file BaseEntity.cpp.

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

◆ ApplyModUpdateFieldValue()

template<typename T >
void BaseEntity::ApplyModUpdateFieldValue ( UF::UpdateFieldPrivateSetter< T >  setter,
typename UF::UpdateFieldPrivateSetter< T >::value_type  mod,
bool  apply 
)
inlineprotected

Definition at line 306 of file BaseEntity.h.

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

◆ ApplyPercentModUpdateFieldValue()

template<typename T >
void BaseEntity::ApplyPercentModUpdateFieldValue ( UF::UpdateFieldPrivateSetter< T >  setter,
float  percent,
bool  apply 
)
inlineprotected

Definition at line 320 of file BaseEntity.h.

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

◆ BuildCreateUpdateBlockForPlayer()

void BaseEntity::BuildCreateUpdateBlockForPlayer ( UpdateData data,
Player target 
) const
virtual

Reimplemented in Bag, and Player.

Definition at line 94 of file BaseEntity.cpp.

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

◆ BuildDestroyUpdateBlock()

void BaseEntity::BuildDestroyUpdateBlock ( UpdateData data) const

Definition at line 195 of file BaseEntity.cpp.

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

◆ BuildEntityFragments()

void BaseEntity::BuildEntityFragments ( ByteBuffer data,
std::span< WowCS::EntityFragment const >  fragments 
)
inlinestaticprotected

Definition at line 189 of file BaseEntity.cpp.

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

◆ BuildFieldsUpdate()

void BaseEntity::BuildFieldsUpdate ( Player player,
UpdateDataMapType data_map 
) const

Definition at line 694 of file BaseEntity.cpp.

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

◆ BuildMovementUpdate()

void BaseEntity::BuildMovementUpdate ( ByteBuffer data,
CreateObjectBits  flags,
Player const *  target 
) const
protected

Definition at line 235 of file BaseEntity.cpp.

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

◆ BuildOutOfRangeUpdateBlock()

void BaseEntity::BuildOutOfRangeUpdateBlock ( UpdateData data) const

Definition at line 200 of file BaseEntity.cpp.

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

◆ BuildUpdate()

virtual void BaseEntity::BuildUpdate ( UpdateDataMapType data_map)
inlinevirtual

Reimplemented in Item, WorldObject, Battlenet::Account, and Transport.

Definition at line 200 of file BaseEntity.h.

+ Here is the caller graph for this function:

◆ BuildUpdateChangesMask()

void BaseEntity::BuildUpdateChangesMask ( )

Definition at line 683 of file BaseEntity.cpp.

+ Here is the caller graph for this function:

◆ BuildValuesUpdateBlockForPlayer()

void BaseEntity::BuildValuesUpdateBlockForPlayer ( UpdateData data,
Player const *  target 
) const

Definition at line 159 of file BaseEntity.cpp.

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

◆ ClearDynamicUpdateFieldValues()

template<typename T >
void BaseEntity::ClearDynamicUpdateFieldValues ( UF::DynamicUpdateFieldSetter< T >  setter)
inlineprotected

Definition at line 263 of file BaseEntity.h.

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

◆ ClearUpdateMask()

void BaseEntity::ClearUpdateMask ( bool  remove)

Definition at line 668 of file BaseEntity.cpp.

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

◆ DestroyForPlayer()

void BaseEntity::DestroyForPlayer ( Player const *  target) const
virtual

Reimplemented in Player, and Unit.

Definition at line 213 of file BaseEntity.cpp.

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

◆ DoWithSuppressingObjectUpdates()

template<typename Action >
void BaseEntity::DoWithSuppressingObjectUpdates ( Action &&  action)
inlineprotected

Definition at line 336 of file BaseEntity.h.

+ Here is the caller graph for this function:

◆ ForceUpdateFieldChange()

template<typename T >
void BaseEntity::ForceUpdateFieldChange ( UF::UpdateFieldPrivateSetter< T > const &  )
inline

Definition at line 208 of file BaseEntity.h.

+ Here is the caller graph for this function:

◆ GetDebugInfo()

std::string BaseEntity::GetDebugInfo ( ) const
virtual

Reimplemented in Battlenet::Account, Creature, TempSummon, Minion, Guardian, GameObject, Item, Object, WorldObject, Pet, Player, Transport, and Unit.

Definition at line 700 of file BaseEntity.cpp.

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

◆ GetGUID() [1/2]

ObjectGuid const & BaseEntity::GetGUID ( ) const
inline

Definition at line 163 of file BaseEntity.h.

◆ GetGUID() [2/2]

static ObjectGuid BaseEntity::GetGUID ( BaseEntity const *  o)
inlinestatic

Definition at line 164 of file BaseEntity.h.

+ Here is the call graph for this function:

◆ GetNameForLocaleIdx()

virtual std::string BaseEntity::GetNameForLocaleIdx ( LocaleConstant  locale) const
pure virtual

◆ GetTypeId()

TypeID BaseEntity::GetTypeId ( ) const
inline

Definition at line 166 of file BaseEntity.h.

◆ GetUpdateFieldFlagsFor()

UF::UpdateFieldFlag BaseEntity::GetUpdateFieldFlagsFor ( Player const *  target) const
protectedvirtual

Reimplemented in Item, Battlenet::Account, Player, and Unit.

Definition at line 657 of file BaseEntity.cpp.

+ Here is the caller graph for this function:

◆ InsertDynamicUpdateFieldValue()

template<typename T >
UF::DynamicUpdateFieldSetter< T >::insert_result BaseEntity::InsertDynamicUpdateFieldValue ( UF::DynamicUpdateFieldSetter< T >  setter,
uint32  index 
)
inlineprotected

Definition at line 249 of file BaseEntity.h.

+ Here is the call graph for this function:

◆ InsertSetUpdateFieldValue()

template<typename T >
void BaseEntity::InsertSetUpdateFieldValue ( UF::SetUpdateFieldSetter< T >  setter,
std::type_identity_t< T > const &  key 
)
inlineprotected

Definition at line 277 of file BaseEntity.h.

+ Here is the call graph for this function:

◆ IsAreaTrigger()

bool BaseEntity::IsAreaTrigger ( ) const
inline

Definition at line 177 of file BaseEntity.h.

+ Here is the caller graph for this function:

◆ IsConversation()

bool BaseEntity::IsConversation ( ) const
inline

Definition at line 179 of file BaseEntity.h.

+ Here is the caller graph for this function:

◆ IsCorpse()

bool BaseEntity::IsCorpse ( ) const
inline

Definition at line 176 of file BaseEntity.h.

+ Here is the caller graph for this function:

◆ IsCreature()

bool BaseEntity::IsCreature ( ) const
inline

Definition at line 172 of file BaseEntity.h.

+ Here is the caller graph for this function:

◆ IsDestroyedObject()

bool BaseEntity::IsDestroyedObject ( ) const
inline

Definition at line 198 of file BaseEntity.h.

+ Here is the caller graph for this function:

◆ IsDynObject()

bool BaseEntity::IsDynObject ( ) const
inline

Definition at line 175 of file BaseEntity.h.

+ Here is the caller graph for this function:

◆ IsGameObject()

bool BaseEntity::IsGameObject ( ) const
inline

Definition at line 174 of file BaseEntity.h.

+ Here is the caller graph for this function:

◆ IsInWorld()

bool BaseEntity::IsInWorld ( ) const
inline

Definition at line 158 of file BaseEntity.h.

+ Here is the caller graph for this function:

◆ IsItem()

bool BaseEntity::IsItem ( ) const
inline

Definition at line 170 of file BaseEntity.h.

+ Here is the caller graph for this function:

◆ IsMeshObject()

bool BaseEntity::IsMeshObject ( ) const
inline

Definition at line 180 of file BaseEntity.h.

◆ IsPlayer()

bool BaseEntity::IsPlayer ( ) const
inline

Definition at line 173 of file BaseEntity.h.

◆ IsSceneObject()

bool BaseEntity::IsSceneObject ( ) const
inline

Definition at line 178 of file BaseEntity.h.

+ Here is the caller graph for this function:

◆ isType()

bool BaseEntity::isType ( TypeMask  mask) const
inline

Definition at line 167 of file BaseEntity.h.

◆ IsUnit()

bool BaseEntity::IsUnit ( ) const
inline

Definition at line 171 of file BaseEntity.h.

+ Here is the caller graph for this function:

◆ IsWorldObject()

bool BaseEntity::IsWorldObject ( ) const
inline

Definition at line 169 of file BaseEntity.h.

+ Here is the caller graph for this function:

◆ operator=() [1/2]

BaseEntity & BaseEntity::operator= ( BaseEntity &&  right)
privatedelete

◆ operator=() [2/2]

BaseEntity & BaseEntity::operator= ( BaseEntity const &  right)
privatedelete

◆ PrepareValuesUpdateBuffer()

ByteBuffer & BaseEntity::PrepareValuesUpdateBuffer ( UpdateData data) const

Definition at line 205 of file BaseEntity.cpp.

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

◆ RemoveDynamicUpdateFieldValue()

template<typename T >
void BaseEntity::RemoveDynamicUpdateFieldValue ( UF::DynamicUpdateFieldSetter< T >  setter,
uint32  index 
)
inlineprotected

Definition at line 256 of file BaseEntity.h.

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

◆ RemoveFromObjectUpdate()

virtual void BaseEntity::RemoveFromObjectUpdate ( )
protectedpure virtual

Implemented in Battlenet::Account, Item, and WorldObject.

+ Here is the caller graph for this function:

◆ RemoveFromWorld()

void BaseEntity::RemoveFromWorld ( )
virtual

Reimplemented in AreaTrigger, Conversation, Corpse, Creature, TempSummon, Minion, DynamicObject, GameObject, Bag, Object, WorldObject, Pet, Player, SceneObject, and Unit.

Definition at line 83 of file BaseEntity.cpp.

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

◆ RemoveMapUpdateFieldValue()

template<typename K , typename V >
void BaseEntity::RemoveMapUpdateFieldValue ( UF::MapUpdateFieldSetter< K, V >  setter,
std::type_identity_t< K > const &  key 
)
inlineprotected

Definition at line 270 of file BaseEntity.h.

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

◆ RemoveOptionalUpdateFieldValue()

template<typename T >
void BaseEntity::RemoveOptionalUpdateFieldValue ( UF::OptionalUpdateFieldSetter< T >  setter)
inlineprotected

Definition at line 291 of file BaseEntity.h.

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

◆ RemoveSetUpdateFieldValue()

template<typename T >
void BaseEntity::RemoveSetUpdateFieldValue ( UF::SetUpdateFieldSetter< T >  setter,
std::type_identity_t< T > const &  key 
)
inlineprotected

Definition at line 284 of file BaseEntity.h.

+ Here is the call graph for this function:

◆ RemoveUpdateFieldFlagValue()

template<typename T >
void BaseEntity::RemoveUpdateFieldFlagValue ( UF::UpdateFieldPrivateSetter< T >  setter,
typename UF::UpdateFieldPrivateSetter< T >::value_type  flag 
)
inlineprotected

Definition at line 235 of file BaseEntity.h.

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

◆ SendOutOfRangeForPlayer()

void BaseEntity::SendOutOfRangeForPlayer ( Player const *  target) const

Definition at line 224 of file BaseEntity.cpp.

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

◆ SendUpdateToPlayer()

void BaseEntity::SendUpdateToPlayer ( Player player) const

Definition at line 145 of file BaseEntity.cpp.

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

◆ SetDestroyedObject()

void BaseEntity::SetDestroyedObject ( bool  destroyed)
inline

Definition at line 199 of file BaseEntity.h.

+ Here is the caller graph for this function:

◆ SetIsNewObject()

void BaseEntity::SetIsNewObject ( bool  enable)
inline

Definition at line 197 of file BaseEntity.h.

◆ SetUpdateFieldFlagValue()

template<typename T >
void BaseEntity::SetUpdateFieldFlagValue ( UF::UpdateFieldPrivateSetter< T >  setter,
typename UF::UpdateFieldPrivateSetter< T >::value_type  flag 
)
inlineprotected

Definition at line 228 of file BaseEntity.h.

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

◆ SetUpdateFieldStatValue()

template<typename T >
void BaseEntity::SetUpdateFieldStatValue ( UF::UpdateFieldPrivateSetter< T >  setter,
typename UF::UpdateFieldPrivateSetter< T >::value_type  value 
)
inlineprotected

Definition at line 299 of file BaseEntity.h.

+ Here is the caller graph for this function:

◆ SetUpdateFieldValue()

template<typename T >
void BaseEntity::SetUpdateFieldValue ( UF::UpdateFieldPrivateSetter< T >  setter,
typename UF::UpdateFieldPrivateSetter< T >::value_type  value 
)
inlineprotected

Definition at line 221 of file BaseEntity.h.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_entityFragments

WowCS::EntityFragmentsHolder BaseEntity::m_entityFragments
protected

Definition at line 353 of file BaseEntity.h.

◆ m_guid

ObjectGuid BaseEntity::m_guid
private

Definition at line 153 of file BaseEntity.h.

◆ m_inWorld

bool BaseEntity::m_inWorld = false
private

Definition at line 362 of file BaseEntity.h.

◆ m_isDestroyedObject

bool BaseEntity::m_isDestroyedObject = false
private

Definition at line 364 of file BaseEntity.h.

◆ m_isNewObject

bool BaseEntity::m_isNewObject = false
private

Definition at line 363 of file BaseEntity.h.

◆ m_objectTypeId

TypeID BaseEntity::m_objectTypeId = NUM_CLIENT_OBJECT_TYPES
protected

Definition at line 351 of file BaseEntity.h.

◆ m_objectUpdated

bool BaseEntity::m_objectUpdated = false
protected

Definition at line 359 of file BaseEntity.h.

◆ m_updateFlag

CreateObjectBits BaseEntity::m_updateFlag = {}
protected

Definition at line 352 of file BaseEntity.h.

◆ m_values

UF::UpdateFieldHolder BaseEntity::m_values

Definition at line 205 of file BaseEntity.h.


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