#include "craftdef.h"#include "irrlichttypes.h"#include "log.h"#include "debug.h"#include <sstream>#include <unordered_set>#include <array>#include <algorithm>#include <queue>#include "gamedef.h"#include "inventory.h"#include "itemdef.h"#include "util/string.h"#include "util/numeric.h"#include "util/strfnd.h"Classes | |
| class | CCraftDefManager |
Functions | |
| static bool | isGroupRecipeStr (const std::string &rec_name) |
| static bool | hasGroupItem (const std::vector< std::string > &recipe) |
| static u64 | getHashForString (const std::string &recipe_str) |
| static u64 | getHashForGrid (CraftHashType type, const std::vector< std::string > &grid_names) |
| static bool | inputItemMatchesRecipe (const std::string &inp_name, const std::string &rec_name, IItemDefManager *idef) |
| static std::string | craftGetItemName (const std::string &itemstring, IGameDef *gamedef) |
| static std::vector< std::string > | craftGetItemNames (const std::vector< std::string > &itemstrings, IGameDef *gamedef) |
| static std::vector< std::string > | craftGetItemNames (const std::vector< ItemStack > &items, IGameDef *gamedef) |
| static std::vector< ItemStack > | craftGetItems (const std::vector< std::string > &items, IGameDef *gamedef) |
| static bool | craftGetBounds (const std::vector< std::string > &items, unsigned int width, unsigned int &min_x, unsigned int &max_x, unsigned int &min_y, unsigned int &max_y) |
| static void | craftDecrementInput (CraftInput &input, IGameDef *gamedef) |
| static void | craftDecrementOrReplaceInput (CraftInput &input, std::vector< ItemStack > &output_replacements, const CraftReplacements &replacements, IGameDef *gamedef) |
| static std::string | craftDumpMatrix (const std::vector< std::string > &items, unsigned int width) |
| static std::string | craftDumpMatrix (const std::vector< ItemStack > &items, unsigned int width) |
| static bool | hopcroft_karp_can_match_all (const std::vector< std::vector< u16 > > &bip_graph) |
| static ItemStack | craftToolRepair (const ItemStack &item1, const ItemStack &item2, float additional_wear, IGameDef *gamedef) |
| IWritableCraftDefManager * | createCraftDefManager () |
Variables | |
| constexpr u16 | SHAPELESS_GROUPS_MAX = 30000 |
|
static |
References craftDecrementInput(), and CraftInput::items.
Referenced by craftDecrementInput(), craftDecrementOrReplaceInput(), and CraftDefinitionToolRepair::decrementInput().
|
static |
References craftDecrementInput(), craftDecrementOrReplaceInput(), ItemStack::deSerialize(), IGameDef::idef(), inputItemMatchesRecipe(), CraftInput::items, and CraftReplacements::pairs.
Referenced by craftDecrementOrReplaceInput(), CraftDefinitionCooking::decrementInput(), CraftDefinitionFuel::decrementInput(), CraftDefinitionShaped::decrementInput(), and CraftDefinitionShapeless::decrementInput().
|
static |
|
static |
References craftDumpMatrix(), and x.
Referenced by craftDumpMatrix(), craftDumpMatrix(), CraftDefinitionShaped::dump(), CraftDefinitionShapeless::dump(), and CraftInput::dump().
|
static |
References craftGetBounds(), x, and y.
Referenced by CraftDefinitionShaped::check(), and craftGetBounds().
|
static |
References craftGetItemName(), ItemStack::deSerialize(), IGameDef::idef(), and ItemStack::name.
Referenced by CraftDefinitionCooking::check(), CraftDefinitionFuel::check(), craftGetItemName(), craftGetItemNames(), CraftDefinitionCooking::initHash(), CraftDefinitionFuel::initHash(), and CCraftDefManager::registerCraft().
|
static |
References craftGetItemName(), and craftGetItemNames().
Referenced by CraftDefinitionShaped::check(), CraftDefinitionShapeless::check(), craftGetItemNames(), craftGetItemNames(), CCraftDefManager::getCraftResult(), CraftDefinitionShaped::initHash(), and CraftDefinitionShapeless::initHash().
|
static |
References craftGetItems(), and IGameDef::getItemDefManager().
Referenced by craftGetItems(), CraftDefinitionCooking::getInput(), CraftDefinitionFuel::getInput(), CraftDefinitionShaped::getInput(), and CraftDefinitionShapeless::getInput().
|
static |
References ItemStack::ItemStack(), ItemStack::count, craftToolRepair(), IItemDefManager::get(), ItemDefinition::groups, IGameDef::idef(), ITEM_TOOL, ItemStack::name, ItemDefinition::type, and ItemStack::wear.
Referenced by CraftDefinitionToolRepair::check(), craftToolRepair(), and CraftDefinitionToolRepair::getOutput().
| IWritableCraftDefManager * createCraftDefManager | ( | ) |
References CCraftDefManager::CCraftDefManager(), and createCraftDefManager().
Referenced by DummyGameDef::DummyGameDef(), Server::Server(), and createCraftDefManager().
|
static |
References CRAFT_HASH_TYPE_COUNT, CRAFT_HASH_TYPE_ITEM_NAMES, CRAFT_HASH_TYPE_UNHASHED, getHashForGrid(), and getHashForString().
Referenced by CCraftDefManager::getCraftResult(), CraftDefinitionShaped::getHash(), CraftDefinitionShapeless::getHash(), and getHashForGrid().
|
inlinestatic |
References getHashForString(), and murmur_hash_64_ua().
Referenced by CraftDefinitionCooking::getHash(), CraftDefinitionFuel::getHash(), getHashForGrid(), and getHashForString().
|
static |
References hasGroupItem(), and isGroupRecipeStr().
Referenced by CraftDefinitionShaped::CraftDefinitionShaped(), CraftDefinitionShapeless::CraftDefinitionShapeless(), hasGroupItem(), CraftDefinitionShaped::initHash(), and CraftDefinitionShapeless::initHash().
|
static |
References hopcroft_karp_can_match_all(), and SHAPELESS_GROUPS_MAX.
Referenced by CraftDefinitionShapeless::check(), and hopcroft_karp_can_match_all().
|
static |
References BasicStrfnd< T >::at_end(), IItemDefManager::get(), inputItemMatchesRecipe(), isGroupRecipeStr(), IItemDefManager::isKnown(), and BasicStrfnd< T >::next().
Referenced by CraftDefinitionCooking::check(), CraftDefinitionFuel::check(), CraftDefinitionShaped::check(), CraftDefinitionShapeless::check(), craftDecrementOrReplaceInput(), and inputItemMatchesRecipe().
|
inlinestatic |
References isGroupRecipeStr(), and str_starts_with().
Referenced by CraftDefinitionCooking::CraftDefinitionCooking(), CraftDefinitionFuel::CraftDefinitionFuel(), hasGroupItem(), CraftDefinitionCooking::initHash(), CraftDefinitionFuel::initHash(), inputItemMatchesRecipe(), and isGroupRecipeStr().
|
constexpr |
Referenced by CraftDefinitionShapeless::check(), and hopcroft_karp_can_match_all().