Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
CraftDefinition Class Referenceabstract

#include <craftdef.h>

+ Inheritance diagram for CraftDefinition:

Public Types

enum  RecipePriority {
  PRIORITY_NO_RECIPE , PRIORITY_TOOLREPAIR , PRIORITY_SHAPELESS_AND_GROUPS , PRIORITY_SHAPELESS ,
  PRIORITY_SHAPED_AND_GROUPS , PRIORITY_SHAPED
}
 

Public Member Functions

 CraftDefinition ()=default
 
virtual ~CraftDefinition ()=default
 
virtual std::string getName () const =0
 
virtual bool check (const CraftInput &input, IGameDef *gamedef) const =0
 
RecipePriority getPriority () const
 
virtual CraftOutput getOutput (const CraftInput &input, IGameDef *gamedef) const =0
 
virtual CraftInput getInput (const CraftOutput &output, IGameDef *gamedef) const =0
 
virtual void decrementInput (CraftInput &input, std::vector< ItemStack > &output_replacements, IGameDef *gamedef) const =0
 
CraftHashType getHashType () const
 
virtual u64 getHash (CraftHashType type) const =0
 
virtual void initHash (IGameDef *gamedef)=0
 
virtual std::string dump () const =0
 

Protected Attributes

CraftHashType hash_type
 
RecipePriority priority
 

Member Enumeration Documentation

◆ RecipePriority

Enumerator
PRIORITY_NO_RECIPE 
PRIORITY_TOOLREPAIR 
PRIORITY_SHAPELESS_AND_GROUPS 
PRIORITY_SHAPELESS 
PRIORITY_SHAPED_AND_GROUPS 
PRIORITY_SHAPED 

Constructor & Destructor Documentation

◆ CraftDefinition()

CraftDefinition::CraftDefinition ( )
default

◆ ~CraftDefinition()

virtual CraftDefinition::~CraftDefinition ( )
virtualdefault

Member Function Documentation

◆ check()

virtual bool CraftDefinition::check ( const CraftInput & input,
IGameDef * gamedef ) const
pure virtual

Implemented in CraftDefinitionCooking, CraftDefinitionFuel, CraftDefinitionShaped, CraftDefinitionShapeless, and CraftDefinitionToolRepair.

Referenced by CCraftDefManager::getCraftResult().

+ Here is the caller graph for this function:

◆ decrementInput()

virtual void CraftDefinition::decrementInput ( CraftInput & input,
std::vector< ItemStack > & output_replacements,
IGameDef * gamedef ) const
pure virtual

Implemented in CraftDefinitionCooking, CraftDefinitionFuel, CraftDefinitionShaped, CraftDefinitionShapeless, and CraftDefinitionToolRepair.

Referenced by CCraftDefManager::getCraftResult().

+ Here is the caller graph for this function:

◆ dump()

virtual std::string CraftDefinition::dump ( ) const
pure virtual

Implemented in CraftDefinitionCooking, CraftDefinitionFuel, CraftDefinitionShaped, CraftDefinitionShapeless, and CraftDefinitionToolRepair.

Referenced by CCraftDefManager::registerCraft().

+ Here is the caller graph for this function:

◆ getHash()

virtual u64 CraftDefinition::getHash ( CraftHashType type) const
pure virtual

◆ getHashType()

CraftHashType CraftDefinition::getHashType ( ) const
inline

References hash_type.

◆ getInput()

virtual CraftInput CraftDefinition::getInput ( const CraftOutput & output,
IGameDef * gamedef ) const
pure virtual

Implemented in CraftDefinitionCooking, CraftDefinitionFuel, CraftDefinitionShaped, CraftDefinitionShapeless, and CraftDefinitionToolRepair.

Referenced by push_craft_recipe().

+ Here is the caller graph for this function:

◆ getName()

virtual std::string CraftDefinition::getName ( ) const
pure virtual

◆ getOutput()

virtual CraftOutput CraftDefinition::getOutput ( const CraftInput & input,
IGameDef * gamedef ) const
pure virtual

Implemented in CraftDefinitionCooking, CraftDefinitionFuel, CraftDefinitionShaped, CraftDefinitionShapeless, and CraftDefinitionToolRepair.

Referenced by CCraftDefManager::getCraftResult(), push_craft_recipe(), and CCraftDefManager::registerCraft().

+ Here is the caller graph for this function:

◆ getPriority()

RecipePriority CraftDefinition::getPriority ( ) const
inline

References priority.

Referenced by CCraftDefManager::getCraftResult().

+ Here is the caller graph for this function:

◆ initHash()

virtual void CraftDefinition::initHash ( IGameDef * gamedef)
pure virtual

Member Data Documentation

◆ hash_type

◆ priority


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