-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
55 lines (50 loc) · 1.37 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
#include <ncurses.h>
#include "model/character.h"
#include "model/database.h"
#include "mainmenu.h"
#include "addmenu.h"
#include "findmenu.h"
#include "deletemenu.h"
#include "listmenu.h"
int main() {
Database data;
Mainmenu * mainMenu = new Mainmenu;
Addmenu * addMenu = new Addmenu;
Findmenu * findMenu = new Findmenu;
Deletemenu * deleteMenu = new Deletemenu;
Listmenu * listMenu = new Listmenu;
while (mainMenu->getChoice() != 'e') {
switch(mainMenu->getChoice()) {
case '1':
clear();
refresh();
addMenu->getMenu(data);
mainMenu->getMenu();
break;
case '2':
clear();
refresh();
findMenu->getMenu(data);
mainMenu->getMenu();
break;
case '3':
clear();
refresh();
deleteMenu->getMenu(data);
mainMenu->getMenu();
break;
case '4':
clear();
refresh();
listMenu->getMenu(data);
mainMenu->getMenu();
break;
}
}
delete mainMenu;
delete addMenu;
delete findMenu;
delete deleteMenu;
delete listMenu;
cout << "Program has been successfully terminated";
}