First Interaction with User Interface #1

Merged
andrewlalis merged 11 commits from development into master 2018-02-12 19:40:45 +00:00
2 changed files with 51 additions and 9 deletions
Showing only changes of commit cd3f527785 - Show all commits

View File

@ -14,15 +14,15 @@ Recipe::Recipe(){
}
Recipe::Recipe(string name, vector<RecipeIngredient> ingredients, Instruction instruction, QImage image, vector<RecipeTag> 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<RecipeIngredient> ingredients){
this->ingredients = ingredients;
}
void Recipe::setTags(vector<RecipeTag> 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;
}

View File

@ -48,6 +48,8 @@ public:
//Setters
void setName(string newName);
void setIngredients(vector<RecipeIngredient> ingredients);
void setTags(vector<RecipeTag> tags);
void addIngredient(RecipeIngredient newIngredient);
void setInstruction(Instruction newInstruction);
void setImage(QImage newImage);