RecipeDB/model/recipe/recipe.cpp

46 lines
1.3 KiB
C++
Raw Normal View History

2018-02-12 13:24:11 +00:00
#include "model/recipe/recipe.h"
2018-02-12 13:24:11 +00:00
Recipe::Recipe(){
//Set default values when none are specified.
this->name = "Unnamed Recipe";
this->ingredients = vector<RecipeIngredient>();
this->instruction = Instruction();
this->image = QImage();
this->tags = vector<string>();
this->createdDate = QDate.currentDate();
this->prepTime = QTime(1, 0);
this->cookTime = QTime(0, 30);
this->servings = 10;
}
Recipe::Recipe(string name, vector<RecipeIngredient> ingredients, Instruction instruction, QImage image, vector<string> 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;
2018-02-12 13:24:11 +00:00
}
Recipe::Recipe(string name, vector<RecipeIngredient> ingredients, Instruction instruction)
{
2018-02-12 13:24:11 +00:00
this->name = name;
this->ingredients = ingredients;
this->instruction = instruction;
2018-02-12 13:24:11 +00:00
}
string Recipe::getName(){
return this->name;
}
vector<RecipeIngredient> Recipe::getIngredients(){
2018-02-12 13:24:11 +00:00
return this->ingredients;
}
Instruction Recipe::getInstruction(){
return this->instruction;
}