First Interaction with User Interface #1
|
@ -1,11 +1,11 @@
|
||||||
#include "model/recipe/ingredients/recipeingredient.h"
|
#include "model/recipe/ingredients/recipeingredient.h"
|
||||||
|
|
||||||
RecipeIngredient::RecipeIngredient(int id, string name, string foodGroup, int quantity, UnitOfMeasure unit) : Ingredient(id, name, foodGroup){
|
RecipeIngredient::RecipeIngredient(int id, string name, string foodGroup, float quantity, UnitOfMeasure unit) : Ingredient(id, name, foodGroup){
|
||||||
setQuantity(quantity);
|
setQuantity(quantity);
|
||||||
setUnit(unit);
|
setUnit(unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
RecipeIngredient::RecipeIngredient(Ingredient i, int quantity, UnitOfMeasure unit){
|
RecipeIngredient::RecipeIngredient(Ingredient i, float quantity, UnitOfMeasure unit){
|
||||||
setId(i.getId());
|
setId(i.getId());
|
||||||
setName(i.getName());
|
setName(i.getName());
|
||||||
setFoodGroup(i.getFoodGroup());
|
setFoodGroup(i.getFoodGroup());
|
||||||
|
@ -13,11 +13,19 @@ RecipeIngredient::RecipeIngredient(Ingredient i, int quantity, UnitOfMeasure uni
|
||||||
setUnit(unit);
|
setUnit(unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float RecipeIngredient::getQuantity(){
|
||||||
|
return this->quantity;
|
||||||
|
}
|
||||||
|
|
||||||
|
UnitOfMeasure RecipeIngredient::getUnit(){
|
||||||
|
return this->unit;
|
||||||
|
}
|
||||||
|
|
||||||
string RecipeIngredient::getComment(){
|
string RecipeIngredient::getComment(){
|
||||||
return this->comment;
|
return this->comment;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RecipeIngredient::setQuantity(int newQuantity){
|
void RecipeIngredient::setQuantity(float newQuantity){
|
||||||
this->quantity = newQuantity;
|
this->quantity = newQuantity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,18 +15,22 @@ using namespace std;
|
||||||
class RecipeIngredient : public Ingredient
|
class RecipeIngredient : public Ingredient
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RecipeIngredient(int id, string name, string foodGroup, int quantity, UnitOfMeasure unit);
|
//Constructor for new RecipeIngredient without starting child ingredient.
|
||||||
RecipeIngredient(Ingredient i, int quantity, UnitOfMeasure unit);
|
RecipeIngredient(int id, string name, string foodGroup, float quantity, UnitOfMeasure unit);
|
||||||
|
//Constructor using data from a child ingredient.
|
||||||
|
RecipeIngredient(Ingredient i, float quantity, UnitOfMeasure unit);
|
||||||
|
|
||||||
int getQuantity();
|
//Getters
|
||||||
|
float getQuantity();
|
||||||
UnitOfMeasure getUnit();
|
UnitOfMeasure getUnit();
|
||||||
string getComment();
|
string getComment();
|
||||||
|
|
||||||
void setQuantity(int newQuantity);
|
//Setters
|
||||||
|
void setQuantity(float newQuantity);
|
||||||
void setUnit(UnitOfMeasure newUnit);
|
void setUnit(UnitOfMeasure newUnit);
|
||||||
void setComment(string newComment);
|
void setComment(string newComment);
|
||||||
private:
|
private:
|
||||||
int quantity;
|
float quantity;
|
||||||
UnitOfMeasure unit;
|
UnitOfMeasure unit;
|
||||||
string comment;
|
string comment;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue