diff --git a/model/recipe/ingredients/ingredient.cpp b/model/recipe/ingredients/ingredient.cpp index f0d2cf0..2ce1d2b 100644 --- a/model/recipe/ingredients/ingredient.cpp +++ b/model/recipe/ingredients/ingredient.cpp @@ -1,21 +1,15 @@ #include "model/recipe/ingredients/ingredient.h" Ingredient::Ingredient(){ - setId(-1); setName("NULL"); setFoodGroup("NULL"); } -Ingredient::Ingredient(int id, string name, string foodGroup){ - setId(id); +Ingredient::Ingredient(string name, string foodGroup){ setName(name); setFoodGroup(foodGroup); } -int Ingredient::getId(){ - return this->id; -} - string Ingredient::getName(){ return this->name; } @@ -24,10 +18,6 @@ string Ingredient::getFoodGroup(){ return this->foodGroup; } -void Ingredient::setId(int newId){ - this->id = newId; -} - void Ingredient::setName(string newName){ this->name = newName; } diff --git a/model/recipe/ingredients/ingredient.h b/model/recipe/ingredients/ingredient.h index 5aace81..4444ad0 100644 --- a/model/recipe/ingredients/ingredient.h +++ b/model/recipe/ingredients/ingredient.h @@ -14,17 +14,16 @@ class Ingredient { public: Ingredient(); - Ingredient(int id, string name, string foodGroup); + Ingredient(string name, string foodGroup); - int getId(); + //Getters string getName(); string getFoodGroup(); - void setId(int newId); + //Setters void setName(string newName); void setFoodGroup(string newFoodGroup); protected: - int id; string name; string foodGroup; }; diff --git a/model/recipe/ingredients/recipeingredient.cpp b/model/recipe/ingredients/recipeingredient.cpp index 52fe6bc..e34d299 100644 --- a/model/recipe/ingredients/recipeingredient.cpp +++ b/model/recipe/ingredients/recipeingredient.cpp @@ -1,12 +1,11 @@ #include "model/recipe/ingredients/recipeingredient.h" -RecipeIngredient::RecipeIngredient(int id, string name, string foodGroup, float quantity, UnitOfMeasure unit) : Ingredient(id, name, foodGroup){ +RecipeIngredient::RecipeIngredient(string name, string foodGroup, float quantity, UnitOfMeasure unit) : Ingredient(name, foodGroup){ setQuantity(quantity); setUnit(unit); } RecipeIngredient::RecipeIngredient(Ingredient i, float quantity, UnitOfMeasure unit){ - setId(i.getId()); setName(i.getName()); setFoodGroup(i.getFoodGroup()); setQuantity(quantity); diff --git a/model/recipe/ingredients/recipeingredient.h b/model/recipe/ingredients/recipeingredient.h index 491d20e..ea3ceb5 100644 --- a/model/recipe/ingredients/recipeingredient.h +++ b/model/recipe/ingredients/recipeingredient.h @@ -16,7 +16,7 @@ class RecipeIngredient : public Ingredient { public: //Constructor for new RecipeIngredient without starting child ingredient. - RecipeIngredient(int id, string name, string foodGroup, float quantity, UnitOfMeasure unit); + RecipeIngredient(string name, string foodGroup, float quantity, UnitOfMeasure unit); //Constructor using data from a child ingredient. RecipeIngredient(Ingredient i, float quantity, UnitOfMeasure unit);