-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMenu.cpp
59 lines (51 loc) · 1.21 KB
/
Menu.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
#include "Header.h"
int Menu() {
//textcolor(10);
/*char t;
t = _getch();
while (int(t) != 13)
{
if (t == 1) {
return 1;
}
else if (t == 2) {
ifstream fin; int numberOfSave = 0; FileSave *File[100];
fin.open("SaveFile.txt");
int level; string name;
GotoXY(17, 15);
if (fin.peek() == ifstream::traits_type::eof()) cout << "There is no save file!!";
else {
cout << "There are those save file: ";
int line = 17;
while (!(fin.peek() == ifstream::traits_type::eof())) {
getline(fin, name);
fin >> level;
fin.ignore(100, '\n');
File[numberOfSave] = new FileSave(level, name);
GotoXY(17, line); cout << numberOfSave + 1 << ". " << File[numberOfSave]->getName() << " "
<< File[numberOfSave]->getLevel();
numberOfSave += 1; line += 1;
}
char type; type = _getch();
if (type != 27) {
int a = type - '0';
if (a <= numberOfSave and a > 0) {
presentLevel = File[a - 1]->getLevel() - 1;
UpdateLevel();
}
}
Clean();
}
fin.close();
return 2;
}
else if (t == 3) {
return 3;
}
else if (t == 4) {
return 4;
}
else return 1;
}*/
return 0;
}