Mineserver
A rewrite of Minecraft 1.8.9 in C++ !
Loading...
Searching...
No Matches
player.h
Go to the documentation of this file.
1
12#ifndef MINESERVER_PLAYER_H
13#define MINESERVER_PLAYER_H
14
15#include <entities/entity.h>
16#include <cmd/commands.h>
17
24class Player : public ILiving, ISender
25{
26public:
31 Player() = default;
36 ~Player() override = default;
37
43 std::string name;
44
51 void sendMessage(const ChatMessage &message) override
52 {
53 throw std::runtime_error("Cannot send message to player !");
54 }
55
62 static void loadLua(lua_State *state, const char *namespaceName)
63 {
64 luabridge::getGlobalNamespace(state)
65 .beginNamespace(namespaceName)
66 .beginClass<Player>("Player")
67 .addProperty("name", &Player::name)
68 .endClass()
69 .endNamespace();
70 }
71};
72
73#endif // MINESERVER_PLAYER_H
Minecraft Chat Message implementation.
Definition chatmessage.h:28
Interface Living Entity.
Definition entity.h:89
Sender Interface.
Definition commands.h:29
Player object.
Definition player.h:25
~Player() override=default
Destroy the Player object.
void sendMessage(const ChatMessage &message) override
Sends a message to a player.
Definition player.h:51
Player()=default
Construct a new Player object.
static void loadLua(lua_State *state, const char *namespaceName)
Loads the Player class to a Lua one.
Definition player.h:62
std::string name
Name of the player.
Definition player.h:43
The file handling commands logic.
The file having entities logic.