Minetest 5.9.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 (IMetadata *metadata)
 
 ~PlayerMetaRef ()=default
 
- Public Member Functions inherited from MetaDataRef
virtual ~MetaDataRef ()=default
 

Static Public Member Functions

static void create (lua_State *L, IMetadata *metadata)
 
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 ClientgetClient (lua_State *L)
 
static GUIEnginegetGuiEngine (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)
 
static void registerClass (lua_State *L, const char *name, 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

IMetadatametadata = nullptr
 

Static Private Attributes

static const luaL_Reg methods []
 

Additional Inherited Members

- Protected Member Functions inherited from MetaDataRef
virtual void reportMetadataChange (const std::string *name=nullptr)
 
virtual IMetadatagetmeta (bool auto_create)=0
 
virtual void clearMeta ()=0
 
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)
 Read a string from Lua state L at index without copying it.
 
- Static Protected Member Functions inherited from MetaDataRef
static void registerMetadataClass (lua_State *L, const char *name, 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 ( IMetadata metadata)
inline

◆ ~PlayerMetaRef()

PlayerMetaRef::~PlayerMetaRef ( )
default

Member Function Documentation

◆ clearMeta()

void PlayerMetaRef::clearMeta ( )
privatevirtual

Implements MetaDataRef.

References IMetadata::clear(), and metadata.

+ Here is the call graph for this function:

◆ create()

void PlayerMetaRef::create ( lua_State *  L,
IMetadata metadata 
)
static

References className, and metadata.

Referenced by ObjectRef::l_get_meta().

+ Here is the caller graph for this function:

◆ getmeta()

IMetadata * PlayerMetaRef::getmeta ( bool  auto_create)
privatevirtual

Implements MetaDataRef.

References metadata.

◆ Register()

void PlayerMetaRef::Register ( lua_State *  L)
static

References className, 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(), and Register().

◆ metadata

IMetadata* PlayerMetaRef::metadata = nullptr
private

Referenced by clearMeta(), create(), 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:33
#define luamethod(class, name)
Definition: l_internal.h:31

Referenced by Register().


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