2018-02-12 13:24:11 +00:00
|
|
|
#include "model/recipe/recipe.h"
|
2018-02-02 12:27:57 +00:00
|
|
|
|
2018-02-12 13:24:11 +00:00
|
|
|
Recipe::Recipe(){
|
2018-02-12 18:20:38 +00:00
|
|
|
//Set default values when none are specified.
|
2018-02-12 18:25:48 +00:00
|
|
|
this->Recipe("Unnamed Recipe",
|
|
|
|
vector<RecipeIngredient>(),
|
|
|
|
Instruction(),
|
|
|
|
QImage(),
|
2018-02-12 18:37:35 +00:00
|
|
|
vector<RecipeTag>(),
|
|
|
|
QDate.currentDate(),
|
|
|
|
QTime(1, 0),
|
|
|
|
QTime(0, 30),
|
|
|
|
10.0f);
|
|
|
|
}
|
|
|
|
|
|
|
|
Recipe::Recipe(string name, vector<RecipeIngredient> ingredients, Instruction instruction, QImage image, vector<RecipeTag> tags, QDate createdDate, QTime prepTime, QTime cookTime, float servings){
|
2018-02-12 18:20:38 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
string Recipe::getName(){
|
|
|
|
return this->name;
|
|
|
|
}
|
|
|
|
|
2018-02-12 14:15:04 +00:00
|
|
|
vector<RecipeIngredient> Recipe::getIngredients(){
|
2018-02-12 13:24:11 +00:00
|
|
|
return this->ingredients;
|
|
|
|
}
|
2018-02-02 12:27:57 +00:00
|
|
|
|
2018-02-12 14:15:04 +00:00
|
|
|
Instruction Recipe::getInstruction(){
|
|
|
|
return this->instruction;
|
2018-02-02 12:27:57 +00:00
|
|
|
}
|
2018-02-12 18:37:35 +00:00
|
|
|
|
|
|
|
QImage Recipe::getImage(){
|
|
|
|
return this->image;
|
|
|
|
}
|
|
|
|
|
|
|
|
QDate Recipe::getCreatedDate(){
|
|
|
|
return this->createdDate;
|
|
|
|
}
|
|
|
|
|
|
|
|
QTime Recipe::getPrepTime(){
|
|
|
|
return this->prepTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
QTime Recipe::getCookTime(){
|
|
|
|
return this->cookTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
QTime Recipe::getTotalTime(){
|
|
|
|
return QTime(this->cookTime.hour() + this->prepTime.hour(), this->cookTime.minute() + this->prepTime.minute(), this->cookTime.second() + this->prepTime.second());
|
|
|
|
}
|
|
|
|
|
|
|
|
float Recipe::getServings(){
|
|
|
|
return this->servings;
|
|
|
|
}
|