diff --git a/model/recipe/recipe.cpp b/model/recipe/recipe.cpp index e468fbc..2492254 100644 --- a/model/recipe/recipe.cpp +++ b/model/recipe/recipe.cpp @@ -14,15 +14,15 @@ Recipe::Recipe(){ } Recipe::Recipe(string name, vector ingredients, Instruction instruction, QImage image, vector tags, QDate createdDate, QTime prepTime, QTime cookTime, float servings){ - this->name = name; - this->ingredients = ingredients; - this->instruction = instruction; - this->image = image; - this->tags = tags; - this->createdDate = createdDate; - this->prepTime = prepTime; - this->cookTime = cookTime; - this->servings = servings; + setName(name); + setIngredients(ingredients); + setInstruction(instruction); + setImage(image); + setTags(tags); + setCreatedDate(createdDate); + setPrepTime(prepTime); + setCookTime(cookTime); + setServings(servings); } string Recipe::getName(){ @@ -60,3 +60,43 @@ QTime Recipe::getTotalTime(){ float Recipe::getServings(){ return this->servings; } + +void Recipe::setName(string newName){ + this->name = newName; +} + +void Recipe::setIngredients(vector ingredients){ + this->ingredients = ingredients; +} + +void Recipe::setTags(vector tags){ + this->tags = tags +} + +void Recipe::addIngredient(RecipeIngredient newIngredient){ + this->ingredients.push_back(newIngredient); +} + +void Recipe::setInstruction(Instruction newInstruction){ + this->instruction = newInstruction; +} + +void Recipe::setImage(QImage newImage){ + this->image = newImage; +} + +void Recipe::setCreatedDate(QDate newDate){ + this->createdDate = newDate; +} + +void Recipe::setPrepTime(QTime newTime){ + this->prepTime = newTime; +} + +void Recipe::setCookTime(QTime newTime){ + this->cookTime = newTime; +} + +void Recipe::setServings(float newServingsCount){ + this->servings = newServingsCount; +} diff --git a/model/recipe/recipe.h b/model/recipe/recipe.h index 726e5a4..df24614 100644 --- a/model/recipe/recipe.h +++ b/model/recipe/recipe.h @@ -48,6 +48,8 @@ public: //Setters void setName(string newName); + void setIngredients(vector ingredients); + void setTags(vector tags); void addIngredient(RecipeIngredient newIngredient); void setInstruction(Instruction newInstruction); void setImage(QImage newImage);