diff options
author | gregorycu <gregory.currie@gmail.com> | 2015-01-27 00:46:55 +1100 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2015-03-20 21:41:18 -0400 |
commit | 03e0dd33a847a83d975282c6caf6b926306e7b57 (patch) | |
tree | 01cc0d661b01108c938be6ca0c746c82b0a39263 /src/craftdef.h | |
parent | 1e4fb80d46da634f04d84e3f1065aaabc6909468 (diff) | |
download | minetest-03e0dd33a847a83d975282c6caf6b926306e7b57.tar.gz minetest-03e0dd33a847a83d975282c6caf6b926306e7b57.tar.bz2 minetest-03e0dd33a847a83d975282c6caf6b926306e7b57.zip |
Optimize minetest.get_(all)_craft_recipe(s)
Signed off by: ShadowNinja, kwolekr
Diffstat (limited to 'src/craftdef.h')
-rw-r--r-- | src/craftdef.h | 12 |
1 files changed, 4 insertions, 8 deletions
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<CraftDefinition*> 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<CraftDefinition*> 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(); |