AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Acore::BroadcastTextBuilder Class Reference

#include "ChatTextBuilder.h"

Public Member Functions

 BroadcastTextBuilder (WorldObject const *obj, ChatMsg msgType, uint32 textId, uint8 gender, WorldObject const *target=nullptr, uint32 achievementId=0)
 
void operator() (WorldPacket &data, LocaleConstant locale) const
 
std::size_t operator() (WorldPacket *data, LocaleConstant locale) const
 

Private Attributes

WorldObject const * _source
 
ChatMsg _msgType
 
uint32 _textId
 
uint8 _gender
 
WorldObject const * _target
 
uint32 _achievementId
 

Detailed Description

Constructor & Destructor Documentation

◆ BroadcastTextBuilder()

Acore::BroadcastTextBuilder::BroadcastTextBuilder ( WorldObject const *  obj,
ChatMsg  msgType,
uint32  textId,
uint8  gender,
WorldObject const *  target = nullptr,
uint32  achievementId = 0 
)
inline
34 : _source(obj), _msgType(msgType), _textId(textId), _gender(gender), _target(target), _achievementId(achievementId) { }
uint32 _textId
Definition: ChatTextBuilder.h:42
ChatMsg _msgType
Definition: ChatTextBuilder.h:41
uint8 _gender
Definition: ChatTextBuilder.h:43
uint32 _achievementId
Definition: ChatTextBuilder.h:45
WorldObject const * _target
Definition: ChatTextBuilder.h:44
WorldObject const * _source
Definition: ChatTextBuilder.h:40

Member Function Documentation

◆ operator()() [1/2]

void Acore::BroadcastTextBuilder::operator() ( WorldPacket data,
LocaleConstant  locale 
) const
24{
25 BroadcastText const* bct = sObjectMgr->GetBroadcastText(_textId);
26 ChatHandler::BuildChatPacket(data, _msgType, bct ? Language(bct->LanguageID) : LANG_UNIVERSAL, _source, _target, bct ? bct->GetText(locale, _gender) : "", _achievementId, "", locale);
27}
#define sObjectMgr
Definition: ObjectMgr.h:1623
Language
Definition: SharedDefines.h:734
@ LANG_UNIVERSAL
Definition: SharedDefines.h:735
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:267
Definition: ObjectMgr.h:435
uint32 LanguageID
Definition: ObjectMgr.h:443
std::string const & GetText(LocaleConstant locale=DEFAULT_LOCALE, uint8 gender=GENDER_MALE, bool forceGender=false) const
Definition: ObjectMgr.h:457

References _achievementId, _gender, _msgType, _source, _target, _textId, ChatHandler::BuildChatPacket(), BroadcastText::GetText(), LANG_UNIVERSAL, BroadcastText::LanguageID, and sObjectMgr.

◆ operator()() [2/2]

std::size_t Acore::BroadcastTextBuilder::operator() ( WorldPacket data,
LocaleConstant  locale 
) const

Member Data Documentation

◆ _achievementId

uint32 Acore::BroadcastTextBuilder::_achievementId
private

Referenced by operator()().

◆ _gender

uint8 Acore::BroadcastTextBuilder::_gender
private

Referenced by operator()().

◆ _msgType

ChatMsg Acore::BroadcastTextBuilder::_msgType
private

Referenced by operator()().

◆ _source

WorldObject const* Acore::BroadcastTextBuilder::_source
private

Referenced by operator()().

◆ _target

WorldObject const* Acore::BroadcastTextBuilder::_target
private

Referenced by operator()().

◆ _textId

uint32 Acore::BroadcastTextBuilder::_textId
private

Referenced by operator()().