AzeorthCore 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)
 
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
33 : _source(obj), _gender(gender), _msgType(msgtype), _textGroup(textGroup), _textId(id), _language(language), _target(target) { }
uint32 _textId
Definition: CreatureTextMgr.cpp:47
WorldObject const * _target
Definition: CreatureTextMgr.cpp:49
uint8 _gender
Definition: CreatureTextMgr.cpp:44
WorldObject * _source
Definition: CreatureTextMgr.cpp:43
ChatMsg _msgType
Definition: CreatureTextMgr.cpp:45
uint32 _language
Definition: CreatureTextMgr.cpp:48
uint8 _textGroup
Definition: CreatureTextMgr.cpp:46

Member Function Documentation

◆ operator()()

size_t CreatureTextBuilder::operator() ( WorldPacket data,
LocaleConstant  locale 
) const
inline
36 {
37 std::string const& text = sCreatureTextMgr->GetLocalizedChatString(_source->GetEntry(), _gender, _textGroup, _textId, locale);
38
39 return ChatHandler::BuildChatPacket(*data, _msgType, Language(_language), _source, _target, text, 0, "", locale);
40 }
#define sCreatureTextMgr
Definition: CreatureTextMgr.h:119
Language
Definition: SharedDefines.h:706
static 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:192
uint32 GetEntry() const
Definition: Object.h:109

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()().