diff options
author | Alexander Harkness <bearbin@gmail.com> | 2013-11-24 15:19:41 +0100 |
---|---|---|
committer | Alexander Harkness <bearbin@gmail.com> | 2013-11-24 15:19:41 +0100 |
commit | 675b4aa878f16291ce33fced48a2bc7425f635ae (patch) | |
tree | 409914df27a98f65adf866da669429c4de141b6f /src/BlockEntities/SignEntity.h | |
parent | LineBlockTracer: Using the coord-based block faces. (diff) | |
download | cuberite-675b4aa878f16291ce33fced48a2bc7425f635ae.tar cuberite-675b4aa878f16291ce33fced48a2bc7425f635ae.tar.gz cuberite-675b4aa878f16291ce33fced48a2bc7425f635ae.tar.bz2 cuberite-675b4aa878f16291ce33fced48a2bc7425f635ae.tar.lz cuberite-675b4aa878f16291ce33fced48a2bc7425f635ae.tar.xz cuberite-675b4aa878f16291ce33fced48a2bc7425f635ae.tar.zst cuberite-675b4aa878f16291ce33fced48a2bc7425f635ae.zip |
Diffstat (limited to 'src/BlockEntities/SignEntity.h')
-rw-r--r-- | src/BlockEntities/SignEntity.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/src/BlockEntities/SignEntity.h b/src/BlockEntities/SignEntity.h new file mode 100644 index 000000000..d998ff1e8 --- /dev/null +++ b/src/BlockEntities/SignEntity.h @@ -0,0 +1,67 @@ + +// SignEntity.h + +// Declares the cSignEntity class representing a single sign in the world + + + + + +#pragma once + +#include "BlockEntity.h" + + + + + +namespace Json +{ + class Value; +} + + + + + +// tolua_begin + +class cSignEntity : + public cBlockEntity +{ + typedef cBlockEntity super; + +public: + + // tolua_end + + /// Creates a new empty sign entity at the specified block coords and block type (wall or standing). a_World may be NULL + cSignEntity(BLOCKTYPE a_BlockType, int a_X, int a_Y, int a_Z, cWorld * a_World); + + bool LoadFromJson( const Json::Value& a_Value ); + virtual void SaveToJson(Json::Value& a_Value ) override; + + // tolua_begin + + /// Sets all the sign's lines + void SetLines(const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4); + + /// Sets individual line (zero-based index) + void SetLine(int a_Index, const AString & a_Line); + + /// Retrieves individual line (zero-based index) + AString GetLine(int a_Index) const; + + // tolua_end + + virtual void UsedBy(cPlayer * a_Player) override; + virtual void SendTo(cClientHandle & a_Client) override; + +private: + + AString m_Line[4]; +} ; // tolua_export + + + + |