#include "craftdef.h"
#include "irrlichttypes.h"
#include "log.h"
#include <sstream>
#include <unordered_set>
#include <algorithm>
#include <queue>
#include "gamedef.h"
#include "inventory.h"
#include "util/serialize.h"
#include "util/string.h"
#include "util/numeric.h"
#include "util/strfnd.h"
#include "exceptions.h"
Classes | |
class | CCraftDefManager |
Functions | |
bool | isGroupRecipeStr (const std::string &rec_name) |
static bool | hasGroupItem (const std::vector< std::string > &recipe) |
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) |
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 CraftInput::items.
Referenced by craftDecrementOrReplaceInput(), and CraftDefinitionToolRepair::decrementInput().
|
static |
References craftDecrementInput(), ItemStack::deSerialize(), IGameDef::idef(), inputItemMatchesRecipe(), CraftInput::items, and CraftReplacements::pairs.
Referenced by CraftDefinitionCooking::decrementInput(), CraftDefinitionFuel::decrementInput(), CraftDefinitionShaped::decrementInput(), and CraftDefinitionShapeless::decrementInput().
std::string craftDumpMatrix | ( | const std::vector< ItemStack > & | items, |
unsigned int | width ) |
|
static |
Referenced by CraftDefinitionShaped::dump(), CraftDefinitionShapeless::dump(), and CraftInput::dump().
|
static |
|
static |
References ItemStack::deSerialize(), IGameDef::idef(), and ItemStack::name.
Referenced by CraftDefinitionCooking::check(), CraftDefinitionFuel::check(), craftGetItemNames(), CraftDefinitionCooking::initHash(), CraftDefinitionFuel::initHash(), and CCraftDefManager::registerCraft().
|
static |
|
static |
References craftGetItemName().
Referenced by CraftDefinitionShaped::check(), CraftDefinitionShapeless::check(), CCraftDefManager::getCraftResult(), CraftDefinitionShaped::initHash(), and CraftDefinitionShapeless::initHash().
|
static |
References IGameDef::getItemDefManager().
Referenced by CraftDefinitionCooking::getInput(), CraftDefinitionFuel::getInput(), CraftDefinitionShaped::getInput(), and CraftDefinitionShapeless::getInput().
|
static |
References ItemStack::count, IItemDefManager::get(), ItemDefinition::groups, IGameDef::idef(), ITEM_TOOL, itemgroup_get(), ItemStack::name, ItemDefinition::type, and ItemStack::wear.
Referenced by CraftDefinitionToolRepair::check(), and CraftDefinitionToolRepair::getOutput().
IWritableCraftDefManager * createCraftDefManager | ( | ) |
|
static |
References CRAFT_HASH_TYPE_COUNT, CRAFT_HASH_TYPE_ITEM_NAMES, CRAFT_HASH_TYPE_UNHASHED, and getHashForString().
Referenced by CCraftDefManager::getCraftResult(), CraftDefinitionShaped::getHash(), and CraftDefinitionShapeless::getHash().
|
inline |
References murmur_hash_64_ua().
Referenced by CraftDefinitionCooking::getHash(), CraftDefinitionFuel::getHash(), and getHashForGrid().
|
static |
References isGroupRecipeStr().
Referenced by CraftDefinitionShaped::CraftDefinitionShaped(), CraftDefinitionShapeless::CraftDefinitionShapeless(), CraftDefinitionShaped::initHash(), and CraftDefinitionShapeless::initHash().
|
static |
References SHAPELESS_GROUPS_MAX.
Referenced by CraftDefinitionShapeless::check().
|
static |
References BasicStrfnd< T >::at_end(), IItemDefManager::get(), ItemDefinition::groups, isGroupRecipeStr(), IItemDefManager::isKnown(), itemgroup_get(), and BasicStrfnd< T >::next().
Referenced by CraftDefinitionCooking::check(), CraftDefinitionFuel::check(), CraftDefinitionShaped::check(), CraftDefinitionShapeless::check(), and craftDecrementOrReplaceInput().
|
inline |
References str_starts_with().
Referenced by CraftDefinitionCooking::CraftDefinitionCooking(), CraftDefinitionFuel::CraftDefinitionFuel(), hasGroupItem(), CraftDefinitionCooking::initHash(), CraftDefinitionFuel::initHash(), and inputItemMatchesRecipe().
|
constexpr |
Referenced by CraftDefinitionShapeless::check(), and hopcroft_karp_can_match_all().