Mineserver
A rewrite of Minecraft 1.8.9 in C++ !
Loading...
Searching...
No Matches
entity.h
Go to the documentation of this file.
1
12#ifndef MINESERVER_ENTITY_H
13#define MINESERVER_ENTITY_H
14
15#include <plugins/luaheaders.h>
16#include <types/vector.hpp>
17#include <types/angle.hpp>
18#include <types/uuid.h>
19
27{
28public:
33 virtual ~IEntity() = default;
34
60
67 static void loadLua(lua_State *state, const char *namespaceName)
68 {
69 luabridge::getGlobalNamespace(state)
70 .beginNamespace(namespaceName)
71 .beginClass<IEntity>("IEntity")
72 .addProperty("position", &IEntity::position)
73 .addProperty("yaw", &IEntity::yaw)
74 .addProperty("pitch", &IEntity::pitch)
75 .addProperty("uuid", &IEntity::uuid)
76 .endClass()
77 .endNamespace();
78 }
79};
80
88class ILiving : public IEntity
89{
90public:
95 ~ILiving() override = default;
96
103 static void loadLua(lua_State *state, const char *namespaceName)
104 {
105 luabridge::getGlobalNamespace(state)
106 .beginNamespace(namespaceName)
107 .beginClass<ILiving>("ILiving")
108 .endClass()
109 .endNamespace();
110 }
111};
112
113#endif // MINESERVER_ENTITY_H
The file for angle logic.
Angle class holder.
Definition angle.hpp:25
Interface Entity.
Definition entity.h:27
MinecraftUUID uuid
MinecraftUUID of the entity.
Definition entity.h:59
Vecf position
Position of the entity.
Definition entity.h:39
virtual ~IEntity()=default
Destroy the IEntity object.
Angle pitch
Pitch angle of the entity.
Definition entity.h:53
Angle yaw
Yaw angle of the entity.
Definition entity.h:46
static void loadLua(lua_State *state, const char *namespaceName)
Loads the IEntity class to a Lua one.
Definition entity.h:67
Interface Living Entity.
Definition entity.h:89
~ILiving() override=default
Destroy the ILiving object.
static void loadLua(lua_State *state, const char *namespaceName)
Loads the ILiving class to a Lua one.
Definition entity.h:103
MinecraftUUID compliant data holder.
Definition uuid.h:27
Utility header file for lua things.
The file containing MinecraftUUID logic.
The file handling vector logic.