diff options
Diffstat (limited to 'src/craftdef.h')
-rw-r--r-- | src/craftdef.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/craftdef.h b/src/craftdef.h index 107b4cf98..a2258c6e8 100644 --- a/src/craftdef.h +++ b/src/craftdef.h @@ -130,6 +130,8 @@ public: // Returns the output structure, meaning depends on crafting method // The implementation can assume that check(input) returns true virtual CraftOutput getOutput(const CraftInput &input, IGameDef *gamedef) const=0; + // 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; @@ -164,6 +166,7 @@ public: virtual std::string getName() const; 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 std::string dump() const; @@ -205,6 +208,7 @@ public: virtual std::string getName() const; 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 std::string dump() const; @@ -242,6 +246,7 @@ public: virtual std::string getName() const; 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 std::string dump() const; @@ -281,6 +286,7 @@ public: virtual std::string getName() const; 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 std::string dump() const; @@ -320,6 +326,7 @@ public: virtual std::string getName() const; 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 std::string dump() const; @@ -349,6 +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; // Print crafting recipes for debugging virtual std::string dump() const=0; @@ -365,6 +374,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; // Print crafting recipes for debugging virtual std::string dump() const=0; |