Botcraft 1.21.4
Loading...
Searching...
No Matches
Botcraft::Item Class Reference

#include <Item.hpp>

Public Member Functions

 Item (const ItemProperties &props)
 
ItemId GetId () const
 
const std::string & GetName () const
 
unsigned char GetStackSize () const
 
ToolType GetToolType () const
 
ToolMaterial GetToolMaterial () const
 
int GetMaxDurability () const
 Get the max durability of this item.
 

Private Member Functions

void LoadTypeAndMaterialFromName ()
 

Private Attributes

ItemId id
 
std::string name
 
unsigned char stack_size
 
int durability
 
ToolType tool_type
 
ToolMaterial tool_material
 

Detailed Description

Definition at line 26 of file Item.hpp.

Constructor & Destructor Documentation

◆ Item()

Member Function Documentation

◆ GetId()

ItemId Botcraft::Item::GetId ( ) const

Definition at line 16 of file Item.cpp.

References id.

Referenced by Botcraft::PhysicsManager::InputsToFly().

◆ GetMaxDurability()

int Botcraft::Item::GetMaxDurability ( ) const

Get the max durability of this item.

Returns
-1 if undefined, max durability otherwise

Definition at line 41 of file Item.cpp.

References durability.

Referenced by Botcraft::PhysicsManager::InputsToFly().

◆ GetName()

const std::string & Botcraft::Item::GetName ( ) const

Definition at line 21 of file Item.cpp.

References name.

◆ GetStackSize()

unsigned char Botcraft::Item::GetStackSize ( ) const

Definition at line 26 of file Item.cpp.

References stack_size.

◆ GetToolMaterial()

ToolMaterial Botcraft::Item::GetToolMaterial ( ) const

Definition at line 36 of file Item.cpp.

References tool_material.

Referenced by Botcraft::DigImpl().

◆ GetToolType()

ToolType Botcraft::Item::GetToolType ( ) const

Definition at line 31 of file Item.cpp.

References tool_type.

Referenced by Botcraft::DigImpl().

◆ LoadTypeAndMaterialFromName()

Member Data Documentation

◆ durability

int Botcraft::Item::durability
private

Definition at line 48 of file Item.hpp.

Referenced by GetMaxDurability(), and Item().

◆ id

ItemId Botcraft::Item::id
private

Definition at line 45 of file Item.hpp.

Referenced by GetId().

◆ name

std::string Botcraft::Item::name
private

Definition at line 46 of file Item.hpp.

Referenced by GetName(), Item(), and LoadTypeAndMaterialFromName().

◆ stack_size

unsigned char Botcraft::Item::stack_size
private

Definition at line 47 of file Item.hpp.

Referenced by GetStackSize(), and Item().

◆ tool_material

ToolMaterial Botcraft::Item::tool_material
private

Definition at line 50 of file Item.hpp.

Referenced by GetToolMaterial(), and LoadTypeAndMaterialFromName().

◆ tool_type

ToolType Botcraft::Item::tool_type
private

Definition at line 49 of file Item.hpp.

Referenced by GetToolType(), and LoadTypeAndMaterialFromName().


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