Minetest  5.4.0
PlayerHPChangeReason Struct Reference

#include <player_sao.h>

+ Collaboration diagram for PlayerHPChangeReason:

Public Types

enum  Type : u8 {
  SET_HP , PLAYER_PUNCH , FALL , NODE_DAMAGE ,
  DROWNING , RESPAWN
}
 

Public Member Functions

bool hasLuaReference () const
 
bool setTypeFromString (const std::string &typestr)
 
std::string getTypeAsString () const
 
 PlayerHPChangeReason (Type type)
 
 PlayerHPChangeReason (Type type, ServerActiveObject *object)
 
 PlayerHPChangeReason (Type type, std::string node)
 

Public Attributes

Type type = SET_HP
 
bool from_mod = false
 
int lua_reference = -1
 
ServerActiveObjectobject = nullptr
 
std::string node
 

Member Enumeration Documentation

◆ Type

Enumerator
SET_HP 
PLAYER_PUNCH 
FALL 
NODE_DAMAGE 
DROWNING 
RESPAWN 

Constructor & Destructor Documentation

◆ PlayerHPChangeReason() [1/3]

PlayerHPChangeReason::PlayerHPChangeReason ( Type  type)
inline

◆ PlayerHPChangeReason() [2/3]

PlayerHPChangeReason::PlayerHPChangeReason ( Type  type,
ServerActiveObject object 
)
inline

◆ PlayerHPChangeReason() [3/3]

PlayerHPChangeReason::PlayerHPChangeReason ( Type  type,
std::string  node 
)
inline

Member Function Documentation

◆ getTypeAsString()

std::string PlayerHPChangeReason::getTypeAsString ( ) const
inline

References DROWNING, FALL, NODE_DAMAGE, PLAYER_PUNCH, RESPAWN, SET_HP, and type.

Referenced by ScriptApiBase::pushPlayerHPChangeReason().

+ Here is the caller graph for this function:

◆ hasLuaReference()

bool PlayerHPChangeReason::hasLuaReference ( ) const
inline

References lua_reference.

Referenced by ObjectRef::l_set_hp(), and ScriptApiBase::pushPlayerHPChangeReason().

+ Here is the caller graph for this function:

◆ setTypeFromString()

bool PlayerHPChangeReason::setTypeFromString ( const std::string &  typestr)
inline

References DROWNING, FALL, NODE_DAMAGE, PLAYER_PUNCH, RESPAWN, SET_HP, and type.

Referenced by ObjectRef::l_set_hp().

+ Here is the caller graph for this function:

Member Data Documentation

◆ from_mod

bool PlayerHPChangeReason::from_mod = false

◆ lua_reference

int PlayerHPChangeReason::lua_reference = -1

◆ node

std::string PlayerHPChangeReason::node

◆ object

ServerActiveObject* PlayerHPChangeReason::object = nullptr

◆ type

Type PlayerHPChangeReason::type = SET_HP

The documentation for this struct was generated from the following file: