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

#include <craftdef.h>

+ Inheritance diagram for IWritableCraftDefManager:
+ Collaboration diagram for IWritableCraftDefManager:

Public Member Functions

 IWritableCraftDefManager ()=default
 
virtual ~IWritableCraftDefManager ()=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 bool clearCraftsByOutput (const CraftOutput &output, IGameDef *gamedef)=0
 
virtual bool clearCraftsByInput (const CraftInput &input, IGameDef *gamedef)=0
 
virtual std::string dump () const =0
 
virtual void registerCraft (CraftDefinition *def, IGameDef *gamedef)=0
 
virtual void clear ()=0
 
virtual void initHashes (IGameDef *gamedef)=0
 
- Public Member Functions inherited from ICraftDefManager
 ICraftDefManager ()=default
 
virtual ~ICraftDefManager ()=default
 

Constructor & Destructor Documentation

◆ IWritableCraftDefManager()

IWritableCraftDefManager::IWritableCraftDefManager ( )
default

◆ ~IWritableCraftDefManager()

virtual IWritableCraftDefManager::~IWritableCraftDefManager ( )
virtualdefault

Member Function Documentation

◆ clear()

virtual void IWritableCraftDefManager::clear ( )
pure virtual

Implemented in CCraftDefManager.

Referenced by TestCraft::testShapeless().

+ Here is the caller graph for this function:

◆ clearCraftsByInput()

virtual bool IWritableCraftDefManager::clearCraftsByInput ( const CraftInput & input,
IGameDef * gamedef )
pure virtual

Implemented in CCraftDefManager.

Referenced by ModApiCraft::l_clear_craft().

+ Here is the caller graph for this function:

◆ clearCraftsByOutput()

virtual bool IWritableCraftDefManager::clearCraftsByOutput ( const CraftOutput & output,
IGameDef * gamedef )
pure virtual

Implemented in CCraftDefManager.

Referenced by ModApiCraft::l_clear_craft().

+ Here is the caller graph for this function:

◆ dump()

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

Implements ICraftDefManager.

Implemented in CCraftDefManager.

◆ getCraftRecipes()

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

Implements ICraftDefManager.

Implemented in CCraftDefManager.

◆ getCraftResult()

virtual bool IWritableCraftDefManager::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.

Implements ICraftDefManager.

Implemented in CCraftDefManager.

Referenced by TestCraft::getDumpedCraftResult().

+ Here is the caller graph for this function:

◆ initHashes()

virtual void IWritableCraftDefManager::initHashes ( IGameDef * gamedef)
pure virtual

Implemented in CCraftDefManager.

Referenced by Server::init(), and TestCraft::testShapeless().

+ Here is the caller graph for this function:

◆ registerCraft()

virtual void IWritableCraftDefManager::registerCraft ( CraftDefinition * def,
IGameDef * gamedef )
pure virtual

Implemented in CCraftDefManager.

Referenced by ModApiCraft::l_register_craft(), and TestCraft::testShapeless().

+ Here is the caller graph for this function:

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