Cuberite
A lightweight, fast and extensible game server for Minecraft
SignEntity.h
Go to the documentation of this file.
1 // SignEntity.h
2 
3 // Declares the cSignEntity class representing a single sign in the world
4 
5 
6 
7 
8 
9 #pragma once
10 
11 #include "BlockEntity.h"
12 
13 
14 
15 
16 
17 // tolua_begin
18 
19 class cSignEntity :
20  public cBlockEntity
21 {
22  // tolua_end
23 
25 
26 public: // tolua_export
27 
29  cSignEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld * a_World);
30 
31  // tolua_begin
32 
34  void SetLines(const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4);
35 
37  void SetLine(size_t a_Index, const AString & a_Line);
38 
40  AString GetLine(size_t a_Index) const;
41 
42  // tolua_end
43 
44  // cBlockEntity overrides:
45  virtual void CopyFrom(const cBlockEntity & a_Src) override;
46  virtual bool UsedBy(cPlayer * a_Player) override;
47  virtual void SendTo(cClientHandle & a_Client) override;
48 
49 private:
50 
51  std::array<AString, 4> m_Line;
52 } ; // tolua_export
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
Definition: ChunkDef.h:44
unsigned char BLOCKTYPE
The datatype used by blockdata.
Definition: ChunkDef.h:41
std::string AString
Definition: StringUtils.h:11
cBlockEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld *a_World)
Definition: BlockEntity.cpp:32
cSignEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld *a_World)
Creates a new empty sign entity at the specified block coords and block type (wall or standing).
Definition: SignEntity.cpp:15
std::array< AString, 4 > m_Line
Definition: SignEntity.h:51
void SetLine(size_t a_Index, const AString &a_Line)
Sets individual line (zero-based index)
Definition: SignEntity.cpp:59
virtual bool UsedBy(cPlayer *a_Player) override
Called when a player uses this entity; should open the UI window.
Definition: SignEntity.cpp:37
void SetLines(const AString &a_Line1, const AString &a_Line2, const AString &a_Line3, const AString &a_Line4)
Sets all the sign's lines.
Definition: SignEntity.cpp:47
virtual void CopyFrom(const cBlockEntity &a_Src) override
Copies all properties of a_Src into this entity, except for its m_World and location.
Definition: SignEntity.cpp:26
virtual void SendTo(cClientHandle &a_Client) override
Sends the packet defining the block entity to the client specified.
Definition: SignEntity.cpp:89
AString GetLine(size_t a_Index) const
Retrieves individual line (zero-based index)
Definition: SignEntity.cpp:74
Definition: Player.h:29
Definition: World.h:53