2018-02-02 12:27:57 +00:00
|
|
|
#ifndef RECIPEINGREDIENT_H
|
|
|
|
#define RECIPEINGREDIENT_H
|
|
|
|
|
|
|
|
#include <string>
|
2018-03-11 07:57:57 +00:00
|
|
|
#include <cmath>
|
2018-02-02 12:27:57 +00:00
|
|
|
|
2018-02-12 14:15:04 +00:00
|
|
|
#include "model/recipe/ingredients/ingredient.h"
|
2018-02-12 18:20:38 +00:00
|
|
|
#include "model/recipe/ingredients/unitofmeasure.h"
|
2018-03-11 07:57:57 +00:00
|
|
|
#include "utils/stringutils.h"
|
2018-02-02 12:27:57 +00:00
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
2018-02-12 15:27:24 +00:00
|
|
|
/**
|
|
|
|
* @brief The RecipeIngredient class represents both an ingredient and a unit of measure, to be used in a recipe object.
|
|
|
|
*/
|
|
|
|
|
2018-02-02 12:27:57 +00:00
|
|
|
class RecipeIngredient : public Ingredient
|
|
|
|
{
|
|
|
|
public:
|
2018-02-12 18:48:22 +00:00
|
|
|
//Constructor for new RecipeIngredient without starting child ingredient.
|
2018-03-10 07:51:17 +00:00
|
|
|
RecipeIngredient(string name, string foodGroup, float quantity, UnitOfMeasure unit, string comment);
|
2018-02-12 18:48:22 +00:00
|
|
|
//Constructor using data from a child ingredient.
|
2018-03-10 07:51:17 +00:00
|
|
|
RecipeIngredient(Ingredient i, float quantity, UnitOfMeasure unit, string comment);
|
2018-03-30 12:33:48 +00:00
|
|
|
RecipeIngredient(Ingredient &i);
|
2018-03-03 09:18:38 +00:00
|
|
|
RecipeIngredient();
|
2018-02-02 12:27:57 +00:00
|
|
|
|
2018-02-12 18:48:22 +00:00
|
|
|
//Getters
|
2018-02-13 09:22:05 +00:00
|
|
|
float getQuantity() const;
|
|
|
|
UnitOfMeasure getUnit() const;
|
|
|
|
string getComment() const;
|
2018-02-02 12:27:57 +00:00
|
|
|
|
2018-02-12 18:48:22 +00:00
|
|
|
//Setters
|
|
|
|
void setQuantity(float newQuantity);
|
2018-02-12 18:20:38 +00:00
|
|
|
void setUnit(UnitOfMeasure newUnit);
|
2018-02-02 12:27:57 +00:00
|
|
|
void setComment(string newComment);
|
2018-03-11 07:57:57 +00:00
|
|
|
string toString();
|
2018-02-02 12:27:57 +00:00
|
|
|
private:
|
2018-02-12 18:48:22 +00:00
|
|
|
float quantity;
|
2018-02-12 18:20:38 +00:00
|
|
|
UnitOfMeasure unit;
|
2018-02-02 12:27:57 +00:00
|
|
|
string comment;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // RECIPEINGREDIENT_H
|