1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Allow replacements in cooking and fuel recipes

This commit is contained in:
Kahrl 2012-02-11 18:10:13 +01:00 committed by Perttu Ahola
parent 430d6e1cca
commit e070f1e525
3 changed files with 69 additions and 38 deletions

View file

@ -106,6 +106,8 @@ struct CraftReplacements
pairs(pairs_)
{}
std::string dump() const;
void serialize(std::ostream &os) const;
void deSerialize(std::istream &is);
};
/*
@ -270,8 +272,9 @@ public:
CraftDefinitionCooking(
const std::string &output_,
const std::string &recipe_,
float cooktime_):
output(output_), recipe(recipe_), cooktime(cooktime_)
float cooktime_,
const CraftReplacements &replacements_):
output(output_), recipe(recipe_), cooktime(cooktime_), replacements(replacements_)
{}
virtual ~CraftDefinitionCooking(){}
@ -293,6 +296,8 @@ private:
std::string recipe;
// Time in seconds
float cooktime;
// Replacement items for decrementInput()
CraftReplacements replacements;
};
/*
@ -305,8 +310,10 @@ public:
CraftDefinitionFuel():
recipe(""), burntime()
{}
CraftDefinitionFuel(std::string recipe_, float burntime_):
recipe(recipe_), burntime(burntime_)
CraftDefinitionFuel(std::string recipe_,
float burntime_,
const CraftReplacements &replacements_):
recipe(recipe_), burntime(burntime_), replacements(replacements_)
{}
virtual ~CraftDefinitionFuel(){}
@ -326,6 +333,8 @@ private:
std::string recipe;
// Time in seconds
float burntime;
// Replacement items for decrementInput()
CraftReplacements replacements;
};
/*