AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
CreatureTextBuilder Class Reference

Public Member Functions

 CreatureTextBuilder (WorldObject *obj, uint8 gender, ChatMsg msgtype, uint8 textGroup, uint32 id, uint32 language, WorldObject const *target)
 
std::size_t operator() (WorldPacket *data, LocaleConstant locale) const
 

Private Attributes

WorldObject_source
 
uint8 _gender
 
ChatMsg _msgType
 
uint8 _textGroup
 
uint32 _textId
 
uint32 _language
 
WorldObject const * _target
 

Detailed Description

Constructor & Destructor Documentation

◆ CreatureTextBuilder()

CreatureTextBuilder::CreatureTextBuilder ( WorldObject obj,
uint8  gender,
ChatMsg  msgtype,
uint8  textGroup,
uint32  id,
uint32  language,
WorldObject const *  target 
)
inline
32 : _source(obj), _gender(gender), _msgType(msgtype), _textGroup(textGroup), _textId(id), _language(language), _target(target) { }
uint32 _textId
Definition: CreatureTextMgr.cpp:46
WorldObject const * _target
Definition: CreatureTextMgr.cpp:48
uint8 _gender
Definition: CreatureTextMgr.cpp:43
WorldObject * _source
Definition: CreatureTextMgr.cpp:42
ChatMsg _msgType
Definition: CreatureTextMgr.cpp:44
uint32 _language
Definition: CreatureTextMgr.cpp:47
uint8 _textGroup
Definition: CreatureTextMgr.cpp:45

Member Function Documentation

◆ operator()()

std::size_t CreatureTextBuilder::operator() ( WorldPacket data,
LocaleConstant  locale 
) const
inline
35 {
36 std::string const& text = sCreatureTextMgr->GetLocalizedChatString(_source->GetEntry(), _gender, _textGroup, _textId, locale);
37
38 return ChatHandler::BuildChatPacket(*data, _msgType, Language(_language), _source, _target, text, 0, "", locale);
39 }
Language
Definition: SharedDefines.h:734
#define sCreatureTextMgr
Definition: CreatureTextMgr.h:118
static std::size_t BuildChatPacket(WorldPacket &data, ChatMsg chatType, Language language, ObjectGuid senderGUID, ObjectGuid receiverGUID, std::string_view message, uint8 chatTag, std::string const &senderName="", std::string const &receiverName="", uint32 achievementId=0, bool gmMessage=false, std::string const &channelName="")
Definition: Chat.cpp:264
uint32 GetEntry() const
Definition: Object.h:115

References _gender, _language, _msgType, _source, _target, _textGroup, _textId, ChatHandler::BuildChatPacket(), Object::GetEntry(), and sCreatureTextMgr.

Member Data Documentation

◆ _gender

uint8 CreatureTextBuilder::_gender
private

Referenced by operator()().

◆ _language

uint32 CreatureTextBuilder::_language
private

Referenced by operator()().

◆ _msgType

ChatMsg CreatureTextBuilder::_msgType
private

Referenced by operator()().

◆ _source

WorldObject* CreatureTextBuilder::_source
private

Referenced by operator()().

◆ _target

WorldObject const* CreatureTextBuilder::_target
private

Referenced by operator()().

◆ _textGroup

uint8 CreatureTextBuilder::_textGroup
private

Referenced by operator()().

◆ _textId

uint32 CreatureTextBuilder::_textId
private

Referenced by operator()().