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

Public Member Functions

 PlayerTextBuilder (WorldObject *obj, WorldObject *speaker, 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
 
WorldObject_talker
 
uint8 _gender
 
ChatMsg _msgType
 
uint8 _textGroup
 
uint32 _textId
 
uint32 _language
 
WorldObject const * _target
 

Detailed Description

Constructor & Destructor Documentation

◆ PlayerTextBuilder()

PlayerTextBuilder::PlayerTextBuilder ( WorldObject obj,
WorldObject speaker,
uint8  gender,
ChatMsg  msgtype,
uint8  textGroup,
uint32  id,
uint32  language,
WorldObject const *  target 
)
inline
55 : _source(obj), _talker(speaker), _gender(gender), _msgType(msgtype), _textGroup(textGroup), _textId(id), _language(language), _target(target) { }
uint32 _textId
Definition: CreatureTextMgr.cpp:70
WorldObject * _talker
Definition: CreatureTextMgr.cpp:66
uint32 _language
Definition: CreatureTextMgr.cpp:71
WorldObject * _source
Definition: CreatureTextMgr.cpp:65
uint8 _textGroup
Definition: CreatureTextMgr.cpp:69
WorldObject const * _target
Definition: CreatureTextMgr.cpp:72
uint8 _gender
Definition: CreatureTextMgr.cpp:67
ChatMsg _msgType
Definition: CreatureTextMgr.cpp:68

Member Function Documentation

◆ operator()()

std::size_t PlayerTextBuilder::operator() ( WorldPacket data,
LocaleConstant  locale 
) const
inline
58 {
59 std::string const& text = sCreatureTextMgr->GetLocalizedChatString(_source->GetEntry(), _gender, _textGroup, _textId, locale);
60
61 return ChatHandler::BuildChatPacket(*data, _msgType, Language(_language), _talker, _target, text, 0, "", locale);
62 }
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, _talker, _target, _textGroup, _textId, ChatHandler::BuildChatPacket(), Object::GetEntry(), and sCreatureTextMgr.

Member Data Documentation

◆ _gender

uint8 PlayerTextBuilder::_gender
private

Referenced by operator()().

◆ _language

uint32 PlayerTextBuilder::_language
private

Referenced by operator()().

◆ _msgType

ChatMsg PlayerTextBuilder::_msgType
private

Referenced by operator()().

◆ _source

WorldObject* PlayerTextBuilder::_source
private

Referenced by operator()().

◆ _talker

WorldObject* PlayerTextBuilder::_talker
private

Referenced by operator()().

◆ _target

WorldObject const* PlayerTextBuilder::_target
private

Referenced by operator()().

◆ _textGroup

uint8 PlayerTextBuilder::_textGroup
private

Referenced by operator()().

◆ _textId

uint32 PlayerTextBuilder::_textId
private

Referenced by operator()().