TrinityCore
Loading...
Searching...
No Matches
ChatTextBuilder.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __CHATTEXT_BUILDER_H
19#define __CHATTEXT_BUILDER_H
20
21#include "Common.h"
22#include "SharedDefines.h"
23#include <string>
24
25class WorldObject;
26class WorldPacket;
27
28namespace Trinity
29{
31 {
32 public:
33 BroadcastTextBuilder(WorldObject const* obj, ChatMsg msgType, uint32 textId, uint8 gender, WorldObject const* target = nullptr, uint32 achievementId = 0)
34 : _source(obj), _msgType(msgType), _textId(textId), _gender(gender), _target(target), _achievementId(achievementId) { }
35
36 void operator()(WorldPacket& data, LocaleConstant locale) const;
37 size_t operator()(WorldPacket* data, LocaleConstant locale) const;
38
39 private:
46 };
47
49 {
50 public:
51 CustomChatTextBuilder(WorldObject const* obj, ChatMsg msgType, std::string_view text, Language language = LANG_UNIVERSAL, WorldObject const* target = nullptr)
52 : _source(obj), _msgType(msgType), _text(text), _language(language), _target(target) { }
53
54 void operator()(WorldPacket& data, LocaleConstant locale) const;
55
56 private:
59 std::string _text;
62 };
63
65 {
66 public:
67 TrinityStringChatBuilder(WorldObject const* obj, ChatMsg msgType, uint32 textId, WorldObject const* target = nullptr, va_list* args = nullptr)
68 : _source(obj), _msgType(msgType), _textId(textId), _target(target), _args(args) { }
69
70 void operator()(WorldPacket& data, LocaleConstant locale) const;
71
72 private:
77 va_list* _args;
78 };
79}
80// namespace Trinity
81
82#endif // __CHATTEXT_BUILDER_H
LocaleConstant
Definition Common.h:48
uint8_t uint8
Definition Define.h:135
uint32_t uint32
Definition Define.h:133
Language
@ LANG_UNIVERSAL
ChatMsg
void operator()(WorldPacket &data, LocaleConstant locale) const
BroadcastTextBuilder(WorldObject const *obj, ChatMsg msgType, uint32 textId, uint8 gender, WorldObject const *target=nullptr, uint32 achievementId=0)
void operator()(WorldPacket &data, LocaleConstant locale) const
CustomChatTextBuilder(WorldObject const *obj, ChatMsg msgType, std::string_view text, Language language=LANG_UNIVERSAL, WorldObject const *target=nullptr)
TrinityStringChatBuilder(WorldObject const *obj, ChatMsg msgType, uint32 textId, WorldObject const *target=nullptr, va_list *args=nullptr)
void operator()(WorldPacket &data, LocaleConstant locale) const