Botcraft 26.3
Loading...
Searching...
No Matches
ProtocolCraft::Chat Class Reference

#include <Chat.hpp>

Inheritance diagram for ProtocolCraft::Chat:
ProtocolCraft::NBT::Tag ProtocolCraft::NetworkType

Public Member Functions

virtual ~Chat () override
 
const std::string & GetText () const
 
- Public Member Functions inherited from ProtocolCraft::NBT::Tag
 Tag ()=default
 
template<typename T , std::enable_if_t< std::is_constructible_v< Internal::TagVariant, T && >, bool > = true>
 Tag (T &&v)
 
template<typename T >
bool is () const
 
template<typename T , std::enable_if_t< std::is_convertible_v< std::vector< T >, Internal::TagListVariant >, bool > = true>
bool is_list_of () const
 
template<typename T >
const T & get () const
 
template<typename T >
T & get ()
 
template<typename T , std::enable_if_t< std::is_convertible_v< std::vector< T >, Internal::TagListVariant >, bool > = true>
const std::vector< T > & as_list_of () const
 
template<typename T , std::enable_if_t< std::is_convertible_v< std::vector< T >, Internal::TagListVariant >, bool > = true>
std::vector< T > & as_list_of ()
 Empty Tag becomes an empty TagList.
 
const Tag & operator[] (const std::string &s) const
 
Tag & operator[] (const std::string &s)
 
size_t size () const
 
bool contains (const std::string &s) const
 
- Public Member Functions inherited from ProtocolCraft::NetworkType
virtual ~NetworkType ()
 
virtual void Read (ReadIterator &iter, size_t &length)
 
virtual void Write (WriteContainer &container) const
 
virtual Json::Value Serialize () const
 

Protected Member Functions

virtual void ReadImpl (ReadIterator &iter, size_t &length) override
 
- Protected Member Functions inherited from ProtocolCraft::NBT::Tag
virtual void WriteImpl (WriteContainer &container) const override
 
std::string ReadNamed (ReadIterator &iter, size_t &length)
 
void WriteNamed (const std::string &tag_name, WriteContainer &container) const
 
virtual Json::Value SerializeImpl () const override
 

Static Private Member Functions

static std::string ParseChatCompound (const NBT::TagCompound &raw)
 
static std::vector< std::string > ParseChatParts (const NBT::Tag &tag)
 
static std::string ParseChat (const NBT::Tag &tag)
 

Private Attributes

std::string text
 

Detailed Description

Definition at line 18 of file Chat.hpp.

Constructor & Destructor Documentation

◆ ~Chat()

virtual ProtocolCraft::Chat::~Chat ( )
inlineoverridevirtual

Definition at line 22 of file Chat.hpp.

Member Function Documentation

◆ GetText()

const std::string & ProtocolCraft::Chat::GetText ( ) const
inline

Definition at line 35 of file Chat.hpp.

References text.

◆ ParseChat()

std::string ProtocolCraft::Chat::ParseChat ( const NBT::Tag &  tag)
staticprivate

Definition at line 289 of file Chat.cpp.

References ParseChatParts().

Referenced by ParseChatCompound(), and ReadImpl().

◆ ParseChatCompound()

std::string ProtocolCraft::Chat::ParseChatCompound ( const NBT::TagCompound &  raw)
staticprivate

Definition at line 82 of file Chat.cpp.

References ProtocolCraft::NBT::TagCompound::contains(), ParseChat(), and ParseChatParts().

Referenced by ParseChatParts().

◆ ParseChatParts()

std::vector< std::string > ProtocolCraft::Chat::ParseChatParts ( const NBT::Tag &  tag)
staticprivate

◆ ReadImpl()

virtual void ProtocolCraft::Chat::ReadImpl ( ReadIterator &  iter,
size_t &  length 
)
inlineoverrideprotectedvirtual

Reimplemented from ProtocolCraft::NBT::Tag.

Definition at line 48 of file Chat.hpp.

References ProtocolCraft::Json::Parse(), ParseChat(), ProtocolCraft::NBT::Tag::ReadImpl(), and text.

Member Data Documentation

◆ text

std::string ProtocolCraft::Chat::text
private

Definition at line 88 of file Chat.hpp.

Referenced by GetText(), and ReadImpl().


The documentation for this class was generated from the following files: