Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
CraftDefinitionCooking Class Reference

#include <craftdef.h>

+ Inheritance diagram for CraftDefinitionCooking:
+ Collaboration diagram for CraftDefinitionCooking:

Public Member Functions

 CraftDefinitionCooking ()=delete
 
 CraftDefinitionCooking (const std::string &output_, const std::string &recipe_, float cooktime_, const CraftReplacements &replacements_)
 
virtual ~CraftDefinitionCooking ()=default
 
virtual std::string getName () const
 
virtual bool check (const CraftInput &input, IGameDef *gamedef) const
 
virtual CraftOutput getOutput (const CraftInput &input, IGameDef *gamedef) const
 
virtual CraftInput getInput (const CraftOutput &output, IGameDef *gamedef) const
 
virtual void decrementInput (CraftInput &input, std::vector< ItemStack > &output_replacements, IGameDef *gamedef) const
 
virtual u64 getHash (CraftHashType type) const
 
virtual void initHash (IGameDef *gamedef)
 
virtual std::string dump () const
 
- Public Member Functions inherited from CraftDefinition
 CraftDefinition ()=default
 
virtual ~CraftDefinition ()=default
 
RecipePriority getPriority () const
 
CraftHashType getHashType () const
 

Private Attributes

std::string output
 
std::string recipe
 
std::string recipe_name
 
bool hash_inited = false
 
float cooktime
 
CraftReplacements replacements
 

Additional Inherited Members

- Public Types inherited from CraftDefinition
enum  RecipePriority {
  PRIORITY_NO_RECIPE , PRIORITY_TOOLREPAIR , PRIORITY_SHAPELESS_AND_GROUPS , PRIORITY_SHAPELESS ,
  PRIORITY_SHAPED_AND_GROUPS , PRIORITY_SHAPED
}
 
- Protected Attributes inherited from CraftDefinition
CraftHashType hash_type
 
RecipePriority priority
 

Constructor & Destructor Documentation

◆ CraftDefinitionCooking() [1/2]

CraftDefinitionCooking::CraftDefinitionCooking ( )
delete

◆ CraftDefinitionCooking() [2/2]

CraftDefinitionCooking::CraftDefinitionCooking ( const std::string & output_,
const std::string & recipe_,
float cooktime_,
const CraftReplacements & replacements_ )

References isGroupRecipeStr(), CraftDefinition::priority, CraftDefinition::PRIORITY_SHAPELESS, CraftDefinition::PRIORITY_SHAPELESS_AND_GROUPS, and recipe.

+ Here is the call graph for this function:

◆ ~CraftDefinitionCooking()

virtual CraftDefinitionCooking::~CraftDefinitionCooking ( )
virtualdefault

Member Function Documentation

◆ check()

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

Implements CraftDefinition.

References CRAFT_METHOD_COOKING, craftGetItemName(), IGameDef::idef(), inputItemMatchesRecipe(), CraftInput::items, CraftInput::method, and recipe.

+ Here is the call graph for this function:

◆ decrementInput()

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

Implements CraftDefinition.

References craftDecrementOrReplaceInput(), and replacements.

+ Here is the call graph for this function:

◆ dump()

std::string CraftDefinitionCooking::dump ( ) const
virtual

Implements CraftDefinition.

References cooktime, CraftReplacements::dump(), output, recipe, and replacements.

+ Here is the call graph for this function:

◆ getHash()

u64 CraftDefinitionCooking::getHash ( CraftHashType type) const
virtual

Implements CraftDefinition.

References CRAFT_HASH_TYPE_COUNT, CRAFT_HASH_TYPE_ITEM_NAMES, getHashForString(), and recipe_name.

+ Here is the call graph for this function:

◆ getInput()

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

Implements CraftDefinition.

References cooktime, CRAFT_METHOD_COOKING, craftGetItems(), and recipe.

+ Here is the call graph for this function:

◆ getName()

std::string CraftDefinitionCooking::getName ( ) const
virtual

Implements CraftDefinition.

◆ getOutput()

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

Implements CraftDefinition.

References cooktime, and output.

◆ initHash()

void CraftDefinitionCooking::initHash ( IGameDef * gamedef)
virtual

Implements CraftDefinition.

References CRAFT_HASH_TYPE_COUNT, CRAFT_HASH_TYPE_ITEM_NAMES, craftGetItemName(), hash_inited, CraftDefinition::hash_type, isGroupRecipeStr(), recipe, and recipe_name.

+ Here is the call graph for this function:

Member Data Documentation

◆ cooktime

float CraftDefinitionCooking::cooktime
private

Referenced by dump(), getInput(), and getOutput().

◆ hash_inited

bool CraftDefinitionCooking::hash_inited = false
private

Referenced by initHash().

◆ output

std::string CraftDefinitionCooking::output
private

Referenced by dump(), and getOutput().

◆ recipe

std::string CraftDefinitionCooking::recipe
private

◆ recipe_name

std::string CraftDefinitionCooking::recipe_name
private

Referenced by getHash(), and initHash().

◆ replacements

CraftReplacements CraftDefinitionCooking::replacements
private

Referenced by decrementInput(), and dump().


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