summaryrefslogtreecommitdiff
path: root/src/craftdef.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/craftdef.h')
-rw-r--r--src/craftdef.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/craftdef.h b/src/craftdef.h
index f62ad3313..cebb2d7ae 100644
--- a/src/craftdef.h
+++ b/src/craftdef.h
@@ -150,7 +150,8 @@ public:
// the inverse of the above
virtual CraftInput getInput(const CraftOutput &output, IGameDef *gamedef) const=0;
// Decreases count of every input item
- virtual void decrementInput(CraftInput &input, IGameDef *gamedef) const=0;
+ virtual void decrementInput(CraftInput &input,
+ std::vector<ItemStack> &output_replacements, IGameDef *gamedef) const=0;
virtual CraftHashType getHashType() const = 0;
virtual u64 getHash(CraftHashType type) const = 0;
@@ -187,7 +188,8 @@ public:
virtual bool check(const CraftInput &input, IGameDef *gamedef) const;
virtual CraftOutput getOutput(const CraftInput &input, IGameDef *gamedef) const;
virtual CraftInput getInput(const CraftOutput &output, IGameDef *gamedef) const;
- virtual void decrementInput(CraftInput &input, IGameDef *gamedef) const;
+ virtual void decrementInput(CraftInput &input,
+ std::vector<ItemStack> &output_replacements, IGameDef *gamedef) const;
virtual CraftHashType getHashType() const;
virtual u64 getHash(CraftHashType type) const;
@@ -235,7 +237,8 @@ public:
virtual bool check(const CraftInput &input, IGameDef *gamedef) const;
virtual CraftOutput getOutput(const CraftInput &input, IGameDef *gamedef) const;
virtual CraftInput getInput(const CraftOutput &output, IGameDef *gamedef) const;
- virtual void decrementInput(CraftInput &input, IGameDef *gamedef) const;
+ virtual void decrementInput(CraftInput &input,
+ std::vector<ItemStack> &output_replacements, IGameDef *gamedef) const;
virtual CraftHashType getHashType() const;
virtual u64 getHash(CraftHashType type) const;
@@ -278,7 +281,8 @@ public:
virtual bool check(const CraftInput &input, IGameDef *gamedef) const;
virtual CraftOutput getOutput(const CraftInput &input, IGameDef *gamedef) const;
virtual CraftInput getInput(const CraftOutput &output, IGameDef *gamedef) const;
- virtual void decrementInput(CraftInput &input, IGameDef *gamedef) const;
+ virtual void decrementInput(CraftInput &input,
+ std::vector<ItemStack> &output_replacements, IGameDef *gamedef) const;
virtual CraftHashType getHashType() const { return CRAFT_HASH_TYPE_COUNT; }
virtual u64 getHash(CraftHashType type) const { return 2; }
@@ -320,7 +324,8 @@ public:
virtual bool check(const CraftInput &input, IGameDef *gamedef) const;
virtual CraftOutput getOutput(const CraftInput &input, IGameDef *gamedef) const;
virtual CraftInput getInput(const CraftOutput &output, IGameDef *gamedef) const;
- virtual void decrementInput(CraftInput &input, IGameDef *gamedef) const;
+ virtual void decrementInput(CraftInput &input,
+ std::vector<ItemStack> &output_replacements, IGameDef *gamedef) const;
virtual CraftHashType getHashType() const;
virtual u64 getHash(CraftHashType type) const;
@@ -365,7 +370,8 @@ public:
virtual bool check(const CraftInput &input, IGameDef *gamedef) const;
virtual CraftOutput getOutput(const CraftInput &input, IGameDef *gamedef) const;
virtual CraftInput getInput(const CraftOutput &output, IGameDef *gamedef) const;
- virtual void decrementInput(CraftInput &input, IGameDef *gamedef) const;
+ virtual void decrementInput(CraftInput &input,
+ std::vector<ItemStack> &output_replacements, IGameDef *gamedef) const;
virtual CraftHashType getHashType() const;
virtual u64 getHash(CraftHashType type) const;
@@ -398,6 +404,7 @@ public:
// The main crafting function
virtual bool getCraftResult(CraftInput &input, CraftOutput &output,
+ std::vector<ItemStack> &output_replacements,
bool decrementInput, IGameDef *gamedef) const=0;
virtual std::vector<CraftDefinition*> getCraftRecipes(CraftOutput &output,
IGameDef *gamedef, unsigned limit=0) const=0;
@@ -414,6 +421,7 @@ public:
// The main crafting function
virtual bool getCraftResult(CraftInput &input, CraftOutput &output,
+ std::vector<ItemStack> &output_replacements,
bool decrementInput, IGameDef *gamedef) const=0;
virtual std::vector<CraftDefinition*> getCraftRecipes(CraftOutput &output,
IGameDef *gamedef, unsigned limit=0) const=0;