-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
102 lines (82 loc) · 2.47 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#include <iostream>
#include <string>
#include <fstream>
#include "Ingredient.h"
#include "Base.h"
#include "Item.h"
#include "Recipe.h"
#include "Database.h"
#include "linked_list.h"
#include "Choice.h"
#include "memtrace.h"
using namespace std;
int main(){
bool run = true;
Choice choice;
Database* database = new Database();
while(run){
switch(choice.getChoice()){
case 0: //main menu
choice.basic_menus();
for(int i = 0; i < 30; i++){cout<<endl;}
break;
case 1: //recipes
choice.basic_menus();
break;
case 2: //ingredients
choice.basic_menus();
break;
case 3: //search
choice.basic_menus();
break;
case 4: //save and exit
choice.basic_menus();
database->save();
delete database;
run = false;
break;
case 11: //recipes->list
choice.titles();
database->listRecipe();
choice.quit();
break;
case 12: //recipes->new
choice.titles();
database->addRec();
choice.quit();
break;
case 13: //recipes->delete
choice.titles();
database->deleteRecipe();
choice.quit();
break;
case 21: //ingredients->list
choice.titles();
database->listBases();
database->listIngredients();
choice.quit();
break;
case 22: //ingredients->new
choice.titles();
database->addIng();
choice.quit();
break;
case 31: //search->by base ingredients
choice.titles();
database->searchByBase();
choice.quit();
break;
case 32: //search->by name
choice.titles();
database->searchByName();
choice.quit();
break;
case -1:
choice.setChoice(0);
break;
default:
choice.setChoice(0);
}
}
return 0;
}