Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
Pointabilities Struct Reference

#include <pointabilities.h>

+ Collaboration diagram for Pointabilities:

Public Member Functions

std::optional< PointabilityTypematchNode (const std::string &name, const ItemGroupList &groups) const
 
std::optional< PointabilityTypematchObject (const std::string &name, const ItemGroupList &groups) const
 
std::optional< PointabilityTypematchPlayer (const ItemGroupList &groups) const
 
void serialize (std::ostream &os) const
 
void deSerialize (std::istream &is)
 

Static Public Member Functions

static PointabilityType deSerializePointabilityType (std::istream &is)
 
static void serializePointabilityType (std::ostream &os, PointabilityType pointable_type)
 
static std::string toStringPointabilityType (PointabilityType pointable_type)
 

Public Attributes

std::unordered_map< std::string, PointabilityTypenodes
 
std::unordered_map< std::string, PointabilityTypenode_groups
 
std::unordered_map< std::string, PointabilityTypeobjects
 
std::unordered_map< std::string, PointabilityTypeobject_groups
 

Static Private Member Functions

static std::optional< PointabilityTypematchGroups (const ItemGroupList &groups, const std::unordered_map< std::string, PointabilityType > &pointable_groups)
 
static void serializeTypeMap (std::ostream &os, const std::unordered_map< std::string, PointabilityType > &map)
 
static void deSerializeTypeMap (std::istream &is, std::unordered_map< std::string, PointabilityType > &map)
 

Member Function Documentation

◆ deSerialize()

void Pointabilities::deSerialize ( std::istream & is)

References deSerializeTypeMap(), node_groups, nodes, object_groups, objects, and readU8().

+ Here is the call graph for this function:

◆ deSerializePointabilityType()

PointabilityType Pointabilities::deSerializePointabilityType ( std::istream & is)
static

References POINTABLE, POINTABLE_BLOCKING, POINTABLE_NOT, and readU8().

Referenced by ContentFeatures::deSerialize(), ObjectProperties::deSerialize(), and deSerializeTypeMap().

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

◆ deSerializeTypeMap()

void Pointabilities::deSerializeTypeMap ( std::istream & is,
std::unordered_map< std::string, PointabilityType > & map )
staticprivate

References deSerializePointabilityType(), deSerializeString16(), and readU32().

Referenced by deSerialize().

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

◆ matchGroups()

std::optional< PointabilityType > Pointabilities::matchGroups ( const ItemGroupList & groups,
const std::unordered_map< std::string, PointabilityType > & pointable_groups )
staticprivate

References itemgroup_get(), POINTABLE, POINTABLE_BLOCKING, and POINTABLE_NOT.

Referenced by matchNode(), matchObject(), and matchPlayer().

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

◆ matchNode()

std::optional< PointabilityType > Pointabilities::matchNode ( const std::string & name,
const ItemGroupList & groups ) const

References matchGroups(), node_groups, and nodes.

+ Here is the call graph for this function:

◆ matchObject()

std::optional< PointabilityType > Pointabilities::matchObject ( const std::string & name,
const ItemGroupList & groups ) const

References matchGroups(), object_groups, and objects.

+ Here is the call graph for this function:

◆ matchPlayer()

std::optional< PointabilityType > Pointabilities::matchPlayer ( const ItemGroupList & groups) const

References matchGroups(), and object_groups.

+ Here is the call graph for this function:

◆ serialize()

void Pointabilities::serialize ( std::ostream & os) const

References node_groups, nodes, object_groups, objects, serializeTypeMap(), and writeU8().

+ Here is the call graph for this function:

◆ serializePointabilityType()

void Pointabilities::serializePointabilityType ( std::ostream & os,
PointabilityType pointable_type )
static

References writeU8().

Referenced by ContentFeatures::serialize(), and ObjectProperties::serialize().

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

◆ serializeTypeMap()

void Pointabilities::serializeTypeMap ( std::ostream & os,
const std::unordered_map< std::string, PointabilityType > & map )
staticprivate

References serializeString16(), writeU32(), and writeU8().

Referenced by serialize().

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

◆ toStringPointabilityType()

std::string Pointabilities::toStringPointabilityType ( PointabilityType pointable_type)
static

References POINTABLE, POINTABLE_BLOCKING, and POINTABLE_NOT.

Referenced by ObjectProperties::dump().

+ Here is the caller graph for this function:

Member Data Documentation

◆ node_groups

std::unordered_map<std::string, PointabilityType> Pointabilities::node_groups

◆ nodes

std::unordered_map<std::string, PointabilityType> Pointabilities::nodes

◆ object_groups

std::unordered_map<std::string, PointabilityType> Pointabilities::object_groups

◆ objects

std::unordered_map<std::string, PointabilityType> Pointabilities::objects

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