Luanti 5.16.0-dev
Loading...
Searching...
No Matches
ItemDefinition Struct Reference

#include <itemdef.h>

Collaboration diagram for ItemDefinition:

Public Member Functions

 ItemDefinition ()
 ItemDefinition (const ItemDefinition &def)
ItemDefinitionoperator= (const ItemDefinition &def)
 ~ItemDefinition ()
void reset ()
void serialize (std::ostream &os, u16 protocol_version) const
void deSerialize (std::istream &is, u16 protocol_version)

Public Attributes

ItemType type
std::string name
std::string description
std::string short_description
ItemImageDef inventory_image
ItemImageDef inventory_overlay
ItemImageDef wield_image
ItemImageDef wield_overlay
std::string palette_image
video::SColor color
v3f wield_scale
u16 stack_max
bool usable
bool liquids_pointable
std::optional< Pointabilitiespointabilities
ToolCapabilitiestool_capabilities
std::optional< WearBarParamswear_bar_params
ItemGroupList groups
SoundSpec sound_place
SoundSpec sound_place_failed
SoundSpec sound_use
SoundSpec sound_use_air
f32 range
std::string node_placement_prediction
std::optional< u8 > place_param2
bool wallmounted_rotate_vertical
TouchInteraction touch_interaction

Private Member Functions

void resetInitial ()

Constructor & Destructor Documentation

◆ ItemDefinition() [1/2]

ItemDefinition::ItemDefinition ( )

References resetInitial().

Referenced by ItemDefinition(), and operator=().

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

◆ ItemDefinition() [2/2]

ItemDefinition::ItemDefinition ( const ItemDefinition & def)

References ItemDefinition(), and resetInitial().

Here is the call graph for this function:

◆ ~ItemDefinition()

ItemDefinition::~ItemDefinition ( )

References reset().

Here is the call graph for this function:

Member Function Documentation

◆ deSerialize()

void ItemDefinition::deSerialize ( std::istream & is,
u16 protocol_version )

References canRead(), color, description, WearBarParams::deserialize(), deSerializeString16(), groups, inventory_image, inventory_overlay, ITEM_NONE, ItemType_END, liquids_pointable, name, node_placement_prediction, palette_image, place_param2, pointabilities, range, readARGB8(), readF32(), readS16(), readU16(), readU8(), readV3F32(), reset(), short_description, sound_place, sound_place_failed, sound_use, sound_use_air, stack_max, tool_capabilities, touch_interaction, type, usable, wallmounted_rotate_vertical, wear_bar_params, wield_image, wield_overlay, and wield_scale.

Referenced by CItemDefManager::deSerialize().

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

◆ operator=()

◆ reset()

void ItemDefinition::reset ( )

◆ resetInitial()

void ItemDefinition::resetInitial ( )
private

References reset(), tool_capabilities, and wear_bar_params.

Referenced by ItemDefinition(), and ItemDefinition().

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

◆ serialize()

void ItemDefinition::serialize ( std::ostream & os,
u16 protocol_version ) const

References color, description, groups, inventory_image, inventory_overlay, liquids_pointable, name, node_placement_prediction, palette_image, place_param2, pointabilities, range, serializeString16(), short_description, sound_place, sound_place_failed, sound_use, sound_use_air, stack_max, tool_capabilities, touch_interaction, type, usable, wallmounted_rotate_vertical, wear_bar_params, wield_image, wield_overlay, wield_scale, writeARGB8(), writeF32(), writeS16(), writeU16(), writeU8(), and writeV3F32().

Referenced by CItemDefManager::serialize().

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

Member Data Documentation

◆ color

video::SColor ItemDefinition::color

◆ description

◆ groups

◆ inventory_image

◆ inventory_overlay

◆ liquids_pointable

◆ name

◆ node_placement_prediction

◆ palette_image

◆ place_param2

◆ pointabilities

◆ range

f32 ItemDefinition::range

◆ short_description

◆ sound_place

◆ sound_place_failed

◆ sound_use

◆ sound_use_air

◆ stack_max

◆ tool_capabilities

◆ touch_interaction

◆ type

◆ usable

◆ wallmounted_rotate_vertical

bool ItemDefinition::wallmounted_rotate_vertical

◆ wear_bar_params

◆ wield_image

◆ wield_overlay

◆ wield_scale


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