Luanti 5.16.0-dev
Loading...
Searching...
No Matches
PlayerMetaRef Class Reference

#include <l_playermeta.h>

Inheritance diagram for PlayerMetaRef:
Collaboration diagram for PlayerMetaRef:

Public Member Functions

 PlayerMetaRef (ServerEnvironment *env, std::string_view name)
 ~PlayerMetaRef ()=default
Public Member Functions inherited from MetaDataRef
virtual ~MetaDataRef ()=default

Static Public Member Functions

static void create (lua_State *L, ServerEnvironment *env, std::string_view name)
static void Register (lua_State *L)
Static Public Member Functions inherited from MetaDataRef
static MetaDataRefcheckAnyMetadata (lua_State *L, int narg)
Static Public Member Functions inherited from ModApiBase
static ScriptApiBasegetScriptApiBase (lua_State *L)
static ServergetServer (lua_State *L)
static ServerInventoryManagergetServerInventoryMgr (lua_State *L)
static EmergeThreadgetEmergeThread (lua_State *L)
static IGameDefgetGameDef (lua_State *L)
static EnvironmentgetEnv (lua_State *L)
static std::string getCurrentModPath (lua_State *L)
template<typename T>
static T * getScriptApi (lua_State *L)
static bool registerFunction (lua_State *L, const char *name, lua_CFunction func, int top)
template<typename T>
static void registerClass (lua_State *L, const luaL_Reg *methods, const luaL_Reg *metamethods)
template<typename T>
static T * checkObject (lua_State *L, int narg)
static int l_deprecated_function (lua_State *L, const char *good, const char *bad, lua_CFunction func)
 A wrapper for deprecated functions.

Static Public Attributes

static const char className [] = "PlayerMetaRef"

Private Member Functions

virtual IMetadatagetmeta (bool auto_create)
virtual void clearMeta ()
virtual void reportMetadataChange (const std::string *name=nullptr)

Private Attributes

ServerEnvironmentm_env
std::string m_name

Static Private Attributes

static const luaL_Reg methods []

Additional Inherited Members

Protected Member Functions inherited from MetaDataRef
virtual void handleToTable (lua_State *L, IMetadata *meta)
virtual bool handleFromTable (lua_State *L, int table, IMetadata *meta)
Protected Member Functions inherited from LuaHelper
template<>
bool readParam (lua_State *L, int index)
template<>
s16 readParam (lua_State *L, int index)
template<>
int readParam (lua_State *L, int index)
template<>
float readParam (lua_State *L, int index)
template<>
v2s16 readParam (lua_State *L, int index)
template<>
v2f readParam (lua_State *L, int index)
template<>
v3f readParam (lua_State *L, int index)
template<>
std::string_view readParam (lua_State *L, int index)
template<>
std::string readParam (lua_State *L, int index)
template<>
std::string_view readParam (lua_State *L, int index)
 Read a string from Lua state L at index without copying it.
Static Protected Member Functions inherited from MetaDataRef
template<class T>
static void registerMetadataClass (lua_State *L, const luaL_Reg *methods)
static int gc_object (lua_State *L)
static int l_contains (lua_State *L)
static int l_get (lua_State *L)
static int l_get_string (lua_State *L)
static int l_set_string (lua_State *L)
static int l_get_int (lua_State *L)
static int l_set_int (lua_State *L)
static int l_get_float (lua_State *L)
static int l_set_float (lua_State *L)
static int l_get_keys (lua_State *L)
static int l_to_table (lua_State *L)
static int l_from_table (lua_State *L)
static int l_equals (lua_State *L)
Static Protected Member Functions inherited from LuaHelper
template<typename T>
static T readParam (lua_State *L, int index)
 Read a value using a template type T from Lua state L at index.
template<typename T>
static T readParam (lua_State *L, int index, const T &default_value)
 Read a value using a template type T from Lua state L at index.

Constructor & Destructor Documentation

◆ PlayerMetaRef()

PlayerMetaRef::PlayerMetaRef ( ServerEnvironment * env,
std::string_view name )
inline

References m_env, and m_name.

Referenced by create().

Here is the caller graph for this function:

◆ ~PlayerMetaRef()

PlayerMetaRef::~PlayerMetaRef ( )
default

Member Function Documentation

◆ clearMeta()

void PlayerMetaRef::clearMeta ( )
privatevirtual

Implements MetaDataRef.

References getmeta().

Here is the call graph for this function:

◆ create()

void PlayerMetaRef::create ( lua_State * L,
ServerEnvironment * env,
std::string_view name )
static

References PlayerMetaRef(), and className.

Referenced by ObjectRef::l_get_meta().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getmeta()

IMetadata * PlayerMetaRef::getmeta ( bool auto_create)
privatevirtual

Implements MetaDataRef.

References m_env, and m_name.

Referenced by clearMeta().

Here is the caller graph for this function:

◆ Register()

void PlayerMetaRef::Register ( lua_State * L)
static

References methods, and MetaDataRef::registerMetadataClass().

Referenced by ServerScripting::InitializeModApi().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reportMetadataChange()

void PlayerMetaRef::reportMetadataChange ( const std::string * name = nullptr)
privatevirtual

Reimplemented from MetaDataRef.

Member Data Documentation

◆ className

const char PlayerMetaRef::className = "PlayerMetaRef"
static

Referenced by create().

◆ m_env

ServerEnvironment* PlayerMetaRef::m_env
private

Referenced by PlayerMetaRef(), and getmeta().

◆ m_name

std::string PlayerMetaRef::m_name
private

Referenced by PlayerMetaRef(), and getmeta().

◆ methods

const luaL_Reg PlayerMetaRef::methods
staticprivate
Initial value:
= {
luamethod(MetaDataRef, contains),
luamethod(MetaDataRef, get_string),
luamethod(MetaDataRef, set_string),
luamethod(MetaDataRef, get_float),
luamethod(MetaDataRef, set_float),
luamethod(MetaDataRef, get_keys),
luamethod(MetaDataRef, to_table),
luamethod(MetaDataRef, from_table),
{0,0}
}
Definition l_metadata.h:18
#define luamethod(class, name)
Definition l_internal.h:16

Referenced by Register().


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