Minetest 5.9.0-dev
 
Loading...
Searching...
No Matches
CraftDefinitionShaped Class Reference

#include <craftdef.h>

+ Inheritance diagram for CraftDefinitionShaped:
+ Collaboration diagram for CraftDefinitionShaped:

Public Member Functions

 CraftDefinitionShaped ()=delete
 
 CraftDefinitionShaped (const std::string &output_, unsigned int width_, const std::vector< std::string > &recipe_, const CraftReplacements &replacements_)
 
virtual ~CraftDefinitionShaped ()=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
 
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
 

Private Attributes

std::string output = ""
 
unsigned int width = 1
 
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

◆ CraftDefinitionShaped() [1/2]

CraftDefinitionShaped::CraftDefinitionShaped ( )
delete

◆ CraftDefinitionShaped() [2/2]

CraftDefinitionShaped::CraftDefinitionShaped ( const std::string &  output_,
unsigned int  width_,
const std::vector< std::string > &  recipe_,
const CraftReplacements replacements_ 
)

References hasGroupItem(), CraftDefinition::priority, CraftDefinition::PRIORITY_SHAPED, CraftDefinition::PRIORITY_SHAPED_AND_GROUPS, and recipe.

+ Here is the call graph for this function:

◆ ~CraftDefinitionShaped()

virtual CraftDefinitionShaped::~CraftDefinitionShaped ( )
virtualdefault

Member Function Documentation

◆ check()

bool CraftDefinitionShaped::check ( const CraftInput input,
IGameDef gamedef 
) const
virtual

Implements CraftDefinition.

References CRAFT_METHOD_NORMAL, craftGetBounds(), craftGetItemNames(), hash_inited, IGameDef::idef(), inputItemMatchesRecipe(), CraftInput::items, CraftInput::method, recipe, recipe_names, CraftInput::width, and width.

+ Here is the call graph for this function:

◆ decrementInput()

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

Implements CraftDefinition.

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

+ Here is the call graph for this function:

◆ getHash()

u64 CraftDefinitionShaped::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 CraftDefinitionShaped::getInput ( const CraftOutput output,
IGameDef gamedef 
) const
virtual

Implements CraftDefinition.

References CRAFT_METHOD_NORMAL, craftGetItems(), recipe, and width.

+ Here is the call graph for this function:

◆ getName()

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

Implements CraftDefinition.

◆ getOutput()

CraftOutput CraftDefinitionShaped::getOutput ( const CraftInput input,
IGameDef gamedef 
) const
virtual

Implements CraftDefinition.

References output.

◆ initHash()

void CraftDefinitionShaped::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 CraftDefinitionShaped::hash_inited = false
private

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

◆ output

std::string CraftDefinitionShaped::output = ""
private

Referenced by dump(), and getOutput().

◆ recipe

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

◆ recipe_names

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

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

◆ replacements

CraftReplacements CraftDefinitionShaped::replacements
private

Referenced by decrementInput(), and dump().

◆ width

unsigned int CraftDefinitionShaped::width = 1
private

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


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