Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
CraftDefinitionShapeless Class Reference

#include <craftdef.h>

+ Inheritance diagram for CraftDefinitionShapeless:
+ Collaboration diagram for CraftDefinitionShapeless:

Public Member Functions

 CraftDefinitionShapeless ()=delete
 
 CraftDefinitionShapeless (const std::string &output_, const std::vector< std::string > &recipe_, const CraftReplacements &replacements_)
 
virtual ~CraftDefinitionShapeless ()=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::vector< std::string > recipe
 
std::vector< std::string > recipe_names
 
bool hash_inited = false
 
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

◆ CraftDefinitionShapeless() [1/2]

CraftDefinitionShapeless::CraftDefinitionShapeless ( )
delete

◆ CraftDefinitionShapeless() [2/2]

CraftDefinitionShapeless::CraftDefinitionShapeless ( const std::string & output_,
const std::vector< std::string > & recipe_,
const CraftReplacements & replacements_ )

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

+ Here is the call graph for this function:

◆ ~CraftDefinitionShapeless()

virtual CraftDefinitionShapeless::~CraftDefinitionShapeless ( )
virtualdefault

Member Function Documentation

◆ check()

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

Implements CraftDefinition.

References CRAFT_METHOD_NORMAL, craftGetItemNames(), errorstream, hash_inited, hopcroft_karp_can_match_all(), IGameDef::idef(), inputItemMatchesRecipe(), CraftInput::items, CraftInput::method, recipe, recipe_names, and SHAPELESS_GROUPS_MAX.

+ Here is the call graph for this function:

◆ decrementInput()

void CraftDefinitionShapeless::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 CraftDefinitionShapeless::dump ( ) const
virtual

Implements CraftDefinition.

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

+ Here is the call graph for this function:

◆ getHash()

u64 CraftDefinitionShapeless::getHash ( CraftHashType type) const
virtual

Implements CraftDefinition.

References CRAFT_HASH_TYPE_COUNT, CRAFT_HASH_TYPE_ITEM_NAMES, getHashForGrid(), hash_inited, and recipe_names.

+ Here is the call graph for this function:

◆ getInput()

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

Implements CraftDefinition.

References CRAFT_METHOD_NORMAL, craftGetItems(), and recipe.

+ Here is the call graph for this function:

◆ getName()

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

Implements CraftDefinition.

◆ getOutput()

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

Implements CraftDefinition.

References output.

◆ initHash()

void CraftDefinitionShapeless::initHash ( IGameDef * gamedef)
virtual

Implements CraftDefinition.

References CRAFT_HASH_TYPE_COUNT, CRAFT_HASH_TYPE_ITEM_NAMES, craftGetItemNames(), hasGroupItem(), hash_inited, CraftDefinition::hash_type, recipe, and recipe_names.

+ Here is the call graph for this function:

Member Data Documentation

◆ hash_inited

bool CraftDefinitionShapeless::hash_inited = false
private

Referenced by check(), getHash(), and initHash().

◆ output

std::string CraftDefinitionShapeless::output
private

Referenced by dump(), and getOutput().

◆ recipe

std::vector<std::string> CraftDefinitionShapeless::recipe
private

◆ recipe_names

std::vector<std::string> CraftDefinitionShapeless::recipe_names
private

Referenced by check(), getHash(), and initHash().

◆ replacements

CraftReplacements CraftDefinitionShapeless::replacements
private

Referenced by decrementInput(), and dump().


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