◆ CCraftDefManager()
CCraftDefManager::CCraftDefManager |
( |
| ) |
|
|
inline |
◆ ~CCraftDefManager()
virtual CCraftDefManager::~CCraftDefManager |
( |
| ) |
|
|
inlinevirtual |
◆ clear()
virtual void CCraftDefManager::clear |
( |
| ) |
|
|
inlinevirtual |
◆ clearCraftsByInput()
virtual bool CCraftDefManager::clearCraftsByInput |
( |
const CraftInput & | input, |
|
|
IGameDef * | gamedef ) |
|
inlinevirtual |
◆ clearCraftsByOutput()
virtual bool CCraftDefManager::clearCraftsByOutput |
( |
const CraftOutput & | output, |
|
|
IGameDef * | gamedef ) |
|
inlinevirtual |
◆ dump()
virtual std::string CCraftDefManager::dump |
( |
| ) |
const |
|
inlinevirtual |
◆ getCraftRecipes()
◆ getCraftResult()
The main crafting function.
- Parameters
-
input | The input grid. |
output | CraftOutput where the result is placed. |
output_replacements | A 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. |
decrementInput | If true, consume or replace input items. |
gamedef | |
- Returns
- true if a result was found, otherwise false.
Implements IWritableCraftDefManager.
References CraftDefinition::check(), craft_hash_type_max, craftGetItemNames(), CraftDefinition::decrementInput(), ItemStack::deSerialize(), CraftInput::empty(), getHashForGrid(), CraftDefinition::getOutput(), CraftDefinition::getPriority(), hash(), IGameDef::idef(), infostream, ItemStack::isKnown(), CraftOutput::item, CraftInput::items, m_craft_defs, and CraftDefinition::PRIORITY_NO_RECIPE.
◆ initHashes()
virtual void CCraftDefManager::initHashes |
( |
IGameDef * | gamedef | ) |
|
|
inlinevirtual |
◆ registerCraft()
◆ m_craft_defs
std::vector<std::unordered_map<u64, std::vector<CraftDefinition*> > > CCraftDefManager::m_craft_defs |
|
private |
◆ m_output_craft_definitions
std::unordered_map<std::string, std::vector<CraftDefinition*> > CCraftDefManager::m_output_craft_definitions |
|
private |
The documentation for this class was generated from the following file: