64 const std::vector<ItemStack> &items_):
71 std::string
dump()
const;
89 std::string
dump()
const;
105 std::vector<std::pair<std::string, std::string> >
pairs;
111 std::string
dump()
const;
156 std::vector<ItemStack> &output_replacements,
IGameDef *gamedef)
const=0;
167 virtual std::string
dump()
const=0;
185 const std::string &output_,
187 const std::vector<std::string> &recipe_,
192 virtual std::string
getName()
const;
197 std::vector<ItemStack> &output_replacements,
IGameDef *gamedef)
const;
203 virtual std::string
dump()
const;
230 const std::string &output_,
231 const std::vector<std::string> &recipe_,
236 virtual std::string
getName()
const;
241 std::vector<ItemStack> &output_replacements,
IGameDef *gamedef)
const;
247 virtual std::string
dump()
const;
276 virtual std::string
getName()
const;
281 std::vector<ItemStack> &output_replacements,
IGameDef *gamedef)
const;
290 virtual std::string
dump()
const;
310 const std::string &output_,
311 const std::string &recipe_,
317 virtual std::string
getName()
const;
322 std::vector<ItemStack> &output_replacements,
IGameDef *gamedef)
const;
328 virtual std::string
dump()
const;
354 const std::string &recipe_,
360 virtual std::string
getName()
const;
365 std::vector<ItemStack> &output_replacements,
IGameDef *gamedef)
const;
371 virtual std::string
dump()
const;
408 std::vector<ItemStack> &output_replacements,
409 bool decrementInput,
IGameDef *gamedef)
const=0;
412 IGameDef *gamedef,
unsigned limit=0)
const=0;
415 virtual std::string
dump()
const=0;
426 std::vector<ItemStack> &output_replacements,
427 bool decrementInput,
IGameDef *gamedef)
const=0;
429 IGameDef *gamedef,
unsigned limit=0)
const=0;
435 virtual std::string
dump()
const=0;
Definition craftdef.h:306
CraftDefinitionCooking()=delete
std::string recipe
Definition craftdef.h:334
virtual ~CraftDefinitionCooking()=default
virtual std::string dump() const
Definition craftdef.cpp:907
std::string recipe_name
Definition craftdef.h:336
std::string output
Definition craftdef.h:332
virtual void initHash(IGameDef *gamedef)
Definition craftdef.cpp:894
virtual u64 getHash(CraftHashType type) const
Definition craftdef.cpp:879
virtual CraftInput getInput(const CraftOutput &output, IGameDef *gamedef) const
Definition craftdef.cpp:866
float cooktime
Definition craftdef.h:340
virtual bool check(const CraftInput &input, IGameDef *gamedef) const
Definition craftdef.cpp:835
CraftReplacements replacements
Definition craftdef.h:342
virtual CraftOutput getOutput(const CraftInput &input, IGameDef *gamedef) const
Definition craftdef.cpp:861
bool hash_inited
Definition craftdef.h:338
virtual std::string getName() const
Definition craftdef.cpp:830
virtual void decrementInput(CraftInput &input, std::vector< ItemStack > &output_replacements, IGameDef *gamedef) const
Definition craftdef.cpp:873
Definition craftdef.h:350
virtual CraftOutput getOutput(const CraftInput &input, IGameDef *gamedef) const
Definition craftdef.cpp:964
virtual void decrementInput(CraftInput &input, std::vector< ItemStack > &output_replacements, IGameDef *gamedef) const
Definition craftdef.cpp:976
std::string recipe
Definition craftdef.h:375
virtual ~CraftDefinitionFuel()=default
std::string recipe_name
Definition craftdef.h:377
virtual u64 getHash(CraftHashType type) const
Definition craftdef.cpp:982
virtual void initHash(IGameDef *gamedef)
Definition craftdef.cpp:997
CraftReplacements replacements
Definition craftdef.h:383
virtual CraftInput getInput(const CraftOutput &output, IGameDef *gamedef) const
Definition craftdef.cpp:969
virtual std::string dump() const
Definition craftdef.cpp:1010
virtual bool check(const CraftInput &input, IGameDef *gamedef) const
Definition craftdef.cpp:938
float burntime
Definition craftdef.h:381
CraftDefinitionFuel()=delete
virtual std::string getName() const
Definition craftdef.cpp:933
bool hash_inited
Definition craftdef.h:379
Definition craftdef.h:181
unsigned int width
Definition craftdef.h:209
CraftReplacements replacements
Definition craftdef.h:217
bool hash_inited
Definition craftdef.h:215
virtual std::string dump() const
Definition craftdef.cpp:452
virtual void initHash(IGameDef *gamedef)
Definition craftdef.cpp:439
std::vector< std::string > recipe_names
Definition craftdef.h:213
std::vector< std::string > recipe
Definition craftdef.h:211
virtual std::string getName() const
Definition craftdef.cpp:341
virtual CraftInput getInput(const CraftOutput &output, IGameDef *gamedef) const
Definition craftdef.cpp:417
virtual CraftOutput getOutput(const CraftInput &input, IGameDef *gamedef) const
Definition craftdef.cpp:412
std::string output
Definition craftdef.h:207
CraftDefinitionShaped()=delete
virtual u64 getHash(CraftHashType type) const
Definition craftdef.cpp:428
virtual bool check(const CraftInput &input, IGameDef *gamedef) const
Definition craftdef.cpp:346
virtual void decrementInput(CraftInput &input, std::vector< ItemStack > &output_replacements, IGameDef *gamedef) const
Definition craftdef.cpp:422
virtual ~CraftDefinitionShaped()=default
Definition craftdef.h:226
virtual ~CraftDefinitionShapeless()=default
virtual bool check(const CraftInput &input, IGameDef *gamedef) const
Definition craftdef.cpp:589
std::vector< std::string > recipe_names
Definition craftdef.h:255
virtual std::string getName() const
Definition craftdef.cpp:477
virtual void initHash(IGameDef *gamedef)
Definition craftdef.cpp:690
virtual CraftInput getInput(const CraftOutput &output, IGameDef *gamedef) const
Definition craftdef.cpp:671
CraftDefinitionShapeless()=delete
bool hash_inited
Definition craftdef.h:257
virtual std::string dump() const
Definition craftdef.cpp:704
virtual CraftOutput getOutput(const CraftInput &input, IGameDef *gamedef) const
Definition craftdef.cpp:666
virtual void decrementInput(CraftInput &input, std::vector< ItemStack > &output_replacements, IGameDef *gamedef) const
Definition craftdef.cpp:676
std::vector< std::string > recipe
Definition craftdef.h:253
CraftReplacements replacements
Definition craftdef.h:259
virtual u64 getHash(CraftHashType type) const
Definition craftdef.cpp:682
std::string output
Definition craftdef.h:251
Definition craftdef.h:118
RecipePriority
Definition craftdef.h:128
@ PRIORITY_TOOLREPAIR
Definition craftdef.h:130
@ PRIORITY_SHAPELESS
Definition craftdef.h:132
@ PRIORITY_NO_RECIPE
Definition craftdef.h:129
@ PRIORITY_SHAPED_AND_GROUPS
Definition craftdef.h:133
@ PRIORITY_SHAPELESS_AND_GROUPS
Definition craftdef.h:131
@ PRIORITY_SHAPED
Definition craftdef.h:134
RecipePriority getPriority() const
Definition craftdef.h:145
virtual bool check(const CraftInput &input, IGameDef *gamedef) const =0
CraftHashType hash_type
Definition craftdef.h:170
CraftDefinition()=default
CraftHashType getHashType() const
Definition craftdef.h:158
virtual std::string dump() const =0
virtual void initHash(IGameDef *gamedef)=0
virtual ~CraftDefinition()=default
virtual u64 getHash(CraftHashType type) const =0
virtual CraftInput getInput(const CraftOutput &output, IGameDef *gamedef) const =0
virtual CraftOutput getOutput(const CraftInput &input, IGameDef *gamedef) const =0
virtual std::string getName() const =0
RecipePriority priority
Definition craftdef.h:171
virtual void decrementInput(CraftInput &input, std::vector< ItemStack > &output_replacements, IGameDef *gamedef) const =0
Definition craftdef.h:390
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 ~ICraftDefManager()=default
ICraftDefManager()=default
virtual std::string dump() const =0
Definition craftdef.h:419
virtual bool clearCraftsByOutput(const CraftOutput &output, IGameDef *gamedef)=0
virtual ~IWritableCraftDefManager()=default
virtual void registerCraft(CraftDefinition *def, IGameDef *gamedef)=0
virtual std::string dump() const =0
virtual void initHashes(IGameDef *gamedef)=0
IWritableCraftDefManager()=default
virtual bool clearCraftsByInput(const CraftInput &input, IGameDef *gamedef)=0
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
CraftHashType
Definition craftdef.h:36
@ CRAFT_HASH_TYPE_ITEM_NAMES
Definition craftdef.h:40
@ CRAFT_HASH_TYPE_UNHASHED
Definition craftdef.h:47
@ CRAFT_HASH_TYPE_COUNT
Definition craftdef.h:43
IWritableCraftDefManager * createCraftDefManager()
Definition craftdef.cpp:1241
CraftMethod
Definition craftdef.h:21
@ CRAFT_METHOD_NORMAL
Definition craftdef.h:23
@ CRAFT_METHOD_COOKING
Definition craftdef.h:25
@ CRAFT_METHOD_FUEL
Definition craftdef.h:27
const int craft_hash_type_max
Definition craftdef.h:50
CraftOutput(const std::string &item_, float time_)
Definition craftdef.h:86
std::string dump() const
Definition craftdef.cpp:298
std::string item
Definition craftdef.h:80
float time
Definition craftdef.h:82
Definition craftdef.h:103
std::string dump() const
Definition craftdef.cpp:309
CraftReplacements(const std::vector< std::pair< std::string, std::string > > &pairs_)
Definition craftdef.h:108
CraftReplacements()=default
std::vector< std::pair< std::string, std::string > > pairs
Definition craftdef.h:105