1
1
#include " MainFunctions.h"
2
2
3
3
void Add_N (AreaList* l) {
4
- int x1, x2, y1 , y2;
4
+ int x1, x2, y1 , y2, retTmp ;
5
5
string name;
6
6
cout << Color_Orange << " please enter the name of the area" << Color_Reset
7
7
<< endl;
@@ -23,20 +23,20 @@ void Add_N(AreaList* l) {
23
23
<< name << " (" << x1 << " ," << y1 << " ) (" << x2 << " ," << y2
24
24
<< " )" << Color_Yellow << " \n\n press any key to continue" << endl;
25
25
getch ();
26
- ( void ) SYS_CLEAR ();
26
+ retTmp = SYS_CLEAR ();
27
27
} else {
28
28
cout << Color_Red << " \n couldn't add the area: " << Color_Green_Blue
29
29
<< name << " (" << x1 << " ," << y1 << " ) (" << x2 << " ," << y2
30
30
<< " )" << Color_Red
31
31
<< " , this area already exist with this name or those points"
32
32
<< Color_Yellow << " \n\n press any key to continue" << endl;
33
33
getch ();
34
- ( void ) SYS_CLEAR ();
34
+ retTmp = SYS_CLEAR ();
35
35
}
36
36
}
37
37
38
38
void Add_P (pizzaDataBase* db, KDTree* ap) {
39
- int x1, y1 ;
39
+ int x1, y1 , retTmp ;
40
40
string name;
41
41
cout << Color_Orange << " please enter the name of the Pizza shop"
42
42
<< Color_Reset << endl;
@@ -54,15 +54,15 @@ void Add_P(pizzaDataBase* db, KDTree* ap) {
54
54
<< " here exist a pizza shop already, couldn't add the pizza shop"
55
55
<< Color_Yellow << " \n\n press any key to continue" << endl;
56
56
getch ();
57
- ( void ) SYS_CLEAR ();
57
+ retTmp = SYS_CLEAR ();
58
58
delete temp;
59
59
} else if (db->addNewMainBranch (temp)) {
60
60
cout << Color_Green
61
61
<< " \n successfully added the main pizza shop: " << Color_Green_Blue
62
62
<< name << " \n location: (" << x1 << " ," << y1 << " )"
63
63
<< Color_Yellow << " \n\n press any key to continue" << endl;
64
64
getch ();
65
- ( void ) SYS_CLEAR ();
65
+ retTmp = SYS_CLEAR ();
66
66
} else {
67
67
cout << Color_Red
68
68
<< " \n couldn't add the main pizza shop: " << Color_Green_Blue
@@ -72,12 +72,12 @@ void Add_P(pizzaDataBase* db, KDTree* ap) {
72
72
ap->deleteNode (temp->getPoint ());
73
73
delete temp;
74
74
getch ();
75
- ( void ) SYS_CLEAR ();
75
+ retTmp = SYS_CLEAR ();
76
76
}
77
77
}
78
78
79
79
void Add_Br (pizzaDataBase* db, KDTree* ap) {
80
- int x1, y1 ;
80
+ int x1, y1 , retTmp ;
81
81
string name, mainName;
82
82
cout << Color_Orange << " please enter the name of the branch Pizza shop"
83
83
<< Color_Reset << endl;
@@ -98,15 +98,15 @@ void Add_Br(pizzaDataBase* db, KDTree* ap) {
98
98
<< " here exist a pizza shop already, couldn't add the pizza shop"
99
99
<< Color_Yellow << " \n\n press any key to continue" << endl;
100
100
getch ();
101
- ( void ) SYS_CLEAR ();
101
+ retTmp = SYS_CLEAR ();
102
102
delete temp;
103
103
} else if (db->addNewBranch (temp)) {
104
104
cout << Color_Green << " \n successfully added the branch pizza shop: "
105
105
<< Color_Green_Blue << name << " \n location: (" << x1 << " ," << y1
106
106
<< " )\n main shop: " << mainName << Color_Yellow
107
107
<< " \n\n press any key to continue" << endl;
108
108
getch ();
109
- ( void ) SYS_CLEAR ();
109
+ retTmp = SYS_CLEAR ();
110
110
} else {
111
111
cout << Color_Red
112
112
<< " \n couldn't add the branch pizza shop: " << Color_Green_Blue
@@ -118,12 +118,12 @@ void Add_Br(pizzaDataBase* db, KDTree* ap) {
118
118
ap->deleteNode (temp->getPoint ());
119
119
delete temp;
120
120
getch ();
121
- ( void ) SYS_CLEAR ();
121
+ retTmp = SYS_CLEAR ();
122
122
}
123
123
}
124
124
125
125
void Del_Br (pizzaDataBase* db, KDTree* ap) {
126
- int x1, y1 ;
126
+ int x1, y1 , retTmp ;
127
127
cout << Color_Orange
128
128
<< " entering the location of the shop that you want to "
129
129
" delete\n\n please enter the x"
@@ -142,12 +142,12 @@ void Del_Br(pizzaDataBase* db, KDTree* ap) {
142
142
<< " (" << x1 << " , " << y1 << " )" << Color_Yellow
143
143
<< " \n\n press any key to continue" << endl;
144
144
getch ();
145
- ( void ) SYS_CLEAR ();
145
+ retTmp = SYS_CLEAR ();
146
146
} else {
147
147
cout << Color_Red << " \n couldn't delete the pizza shop in this location"
148
148
<< Color_Yellow << " \n\n press any key to continue" << endl;
149
149
getch ();
150
- ( void ) SYS_CLEAR ();
150
+ retTmp = SYS_CLEAR ();
151
151
}
152
152
}
153
153
@@ -173,7 +173,7 @@ void List_P(KDTree* ap, AreaList* l) {
173
173
174
174
cout << Color_Yellow << " \n\n press any key to continue" << endl;
175
175
getch ();
176
- ( void ) SYS_CLEAR ();
176
+ int retTmp = SYS_CLEAR ();
177
177
}
178
178
179
179
void List_Brs (pizzaDataBase* db) {
@@ -188,7 +188,7 @@ void List_Brs(pizzaDataBase* db) {
188
188
189
189
cout << Color_Yellow << " \n\n press any key to continue" << endl;
190
190
getch ();
191
- ( void ) SYS_CLEAR ();
191
+ int retTmp = SYS_CLEAR ();
192
192
}
193
193
194
194
void Near_P (KDTree* ap) {
@@ -254,7 +254,7 @@ void Avail_P(KDTree* ap) {
254
254
255
255
cout << Color_Yellow << " \n\n press any key to continue" << endl;
256
256
getch ();
257
- ( void ) SYS_CLEAR ();
257
+ int retTmp = SYS_CLEAR ();
258
258
}
259
259
260
260
void Most_Brs (pizzaDataBase* db) {
0 commit comments