Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
ICraftDefManager Class Referenceabstract

#include <craftdef.h>

+ Inheritance diagram for ICraftDefManager:

Public Member Functions

 ICraftDefManager ()=default
 
virtual ~ICraftDefManager ()=default
 
virtual bool getCraftResult (CraftInput &input, CraftOutput &output, std::vector< ItemStack > &output_replacements, bool decrementInput, IGameDef *gamedef) const =0
 The main crafting function.
 
virtual std::vector< CraftDefinition * > getCraftRecipes (CraftOutput &output, IGameDef *gamedef, unsigned limit=0) const =0
 
virtual std::string dump () const =0
 

Constructor & Destructor Documentation

◆ ICraftDefManager()

ICraftDefManager::ICraftDefManager ( )
default

◆ ~ICraftDefManager()

virtual ICraftDefManager::~ICraftDefManager ( )
virtualdefault

Member Function Documentation

◆ dump()

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

◆ getCraftRecipes()

virtual std::vector< CraftDefinition * > ICraftDefManager::getCraftRecipes ( CraftOutput & output,
IGameDef * gamedef,
unsigned limit = 0 ) const
pure virtual

Implemented in CCraftDefManager, and IWritableCraftDefManager.

Referenced by ModApiCraft::l_get_all_craft_recipes(), and ModApiCraft::l_get_craft_recipe().

+ Here is the caller graph for this function:

◆ getCraftResult()

virtual bool ICraftDefManager::getCraftResult ( CraftInput & input,
CraftOutput & output,
std::vector< ItemStack > & output_replacements,
bool decrementInput,
IGameDef * gamedef ) const
pure virtual

The main crafting function.

Parameters
inputThe input grid.
outputCraftOutput where the result is placed.
output_replacementsA vector of ItemStacks where replacements are placed if they cannot be placed in the input. Replacements can be placed in the input if the stack of the replaced item has a count of 1.
decrementInputIf true, consume or replace input items.
gamedef
Returns
true if a result was found, otherwise false.

Implemented in CCraftDefManager, and IWritableCraftDefManager.

Referenced by getCraftingResult(), and ModApiCraft::l_get_craft_result().

+ Here is the caller graph for this function:

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