From 03e0dd33a847a83d975282c6caf6b926306e7b57 Mon Sep 17 00:00:00 2001 From: gregorycu Date: Tue, 27 Jan 2015 00:46:55 +1100 Subject: Optimize minetest.get_(all)_craft_recipe(s) Signed off by: ShadowNinja, kwolekr --- src/craftdef.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/craftdef.h') diff --git a/src/craftdef.h b/src/craftdef.h index 14dc53003..7902a2e27 100644 --- a/src/craftdef.h +++ b/src/craftdef.h @@ -356,10 +356,8 @@ public: // The main crafting function virtual bool getCraftResult(CraftInput &input, CraftOutput &output, bool decrementInput, IGameDef *gamedef) const=0; - virtual bool getCraftRecipe(CraftInput &input, CraftOutput &output, - IGameDef *gamedef) const=0; virtual std::vector getCraftRecipes(CraftOutput &output, - IGameDef *gamedef) const=0; + IGameDef *gamedef, unsigned limit=0) const=0; // Print crafting recipes for debugging virtual std::string dump() const=0; @@ -376,22 +374,20 @@ public: // The main crafting function virtual bool getCraftResult(CraftInput &input, CraftOutput &output, bool decrementInput, IGameDef *gamedef) const=0; - virtual bool getCraftRecipe(CraftInput &input, CraftOutput &output, - IGameDef *gamedef) const=0; virtual std::vector getCraftRecipes(CraftOutput &output, - IGameDef *gamedef) const=0; + IGameDef *gamedef, unsigned limit=0) const=0; // Print crafting recipes for debugging virtual std::string dump() const=0; // Add a crafting definition. // After calling this, the pointer belongs to the manager. - virtual void registerCraft(CraftDefinition *def)=0; + virtual void registerCraft(CraftDefinition *def, IGameDef *gamedef) = 0; // Delete all crafting definitions virtual void clear()=0; virtual void serialize(std::ostream &os) const=0; - virtual void deSerialize(std::istream &is)=0; + virtual void deSerialize(std::istream &is, IGameDef *gamedef) = 0; }; IWritableCraftDefManager* createCraftDefManager(); -- cgit v1.2.3