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

#include <tool.h>

+ Collaboration diagram for ToolCapabilities:

Public Member Functions

 ToolCapabilities (float full_punch_interval_=1.4f, int max_drop_level_=1, const ToolGCMap &groupcaps_=ToolGCMap(), const DamageGroup &damageGroups_=DamageGroup(), int punch_attack_uses_=0)
 
void serialize (std::ostream &os, u16 version) const
 
void deSerialize (std::istream &is)
 
void serializeJson (std::ostream &os) const
 
void deserializeJson (std::istream &is)
 

Public Attributes

float full_punch_interval
 
int max_drop_level
 
ToolGCMap groupcaps
 
DamageGroup damageGroups
 
int punch_attack_uses
 

Private Member Functions

void deserializeJsonGroupcaps (Json::Value &json)
 
void deserializeJsonDamageGroups (Json::Value &json)
 

Constructor & Destructor Documentation

◆ ToolCapabilities()

ToolCapabilities::ToolCapabilities ( float full_punch_interval_ = 1.4f,
int max_drop_level_ = 1,
const ToolGCMap & groupcaps_ = ToolGCMap(),
const DamageGroup & damageGroups_ = DamageGroup(),
int punch_attack_uses_ = 0 )
inline

Member Function Documentation

◆ deSerialize()

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

References damageGroups, deSerializeString16(), full_punch_interval, groupcaps, max_drop_level, ToolGroupCap::maxlevel, punch_attack_uses, readF32(), readS16(), readU16(), readU32(), readU8(), ToolGroupCap::times, and ToolGroupCap::uses.

Referenced by ItemDefinition::deSerialize().

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

◆ deserializeJson()

void ToolCapabilities::deserializeJson ( std::istream & is)

References deserializeJsonDamageGroups(), deserializeJsonGroupcaps(), full_punch_interval, max_drop_level, and punch_attack_uses.

Referenced by ItemStackMetadata::updateToolCapabilities().

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

◆ deserializeJsonDamageGroups()

void ToolCapabilities::deserializeJsonDamageGroups ( Json::Value & json)
private

References damageGroups.

Referenced by deserializeJson().

+ Here is the caller graph for this function:

◆ deserializeJsonGroupcaps()

void ToolCapabilities::deserializeJsonGroupcaps ( Json::Value & json)
private

References ToolGroupCap::fromJson(), and groupcaps.

Referenced by deserializeJson().

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

◆ serialize()

void ToolCapabilities::serialize ( std::ostream & os,
u16 version ) const

References damageGroups, full_punch_interval, groupcaps, max_drop_level, ToolGroupCap::maxlevel, punch_attack_uses, rangelim, serializeString16(), ToolGroupCap::times, U16_MAX, ToolGroupCap::uses, writeF32(), writeS16(), writeU16(), writeU32(), and writeU8().

Referenced by ItemDefinition::serialize().

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

◆ serializeJson()

void ToolCapabilities::serializeJson ( std::ostream & os) const

References damageGroups, fastWriteJson(), full_punch_interval, groupcaps, max_drop_level, and punch_attack_uses.

Referenced by ItemStackMetadata::setToolCapabilities().

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

Member Data Documentation

◆ damageGroups

◆ full_punch_interval

◆ groupcaps

◆ max_drop_level

◆ punch_attack_uses


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