-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathRecords.cpp
More file actions
55 lines (43 loc) · 759 Bytes
/
Copy pathRecords.cpp
File metadata and controls
55 lines (43 loc) · 759 Bytes
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
#include "Records.h"
#include <iostream>
#include <fstream>
#include <string>
#include <Windows.h>
using namespace std;
Records::Records()
:date("01.01.2015"),
nr_points(0),
nr_level(0),
setline(0),
firstplace(0),
secondplace(0),
thirdplace(0)
{
}
void Records::loading(){
ifstream file;
file.open("Data/records.txt", ios::in);
if (file.good() == false)
{
MessageBox(NULL, "Loading records file failing!", "ERROR", NULL);
return;
}
string line;
int new_numer_line = 0;
while (getline(file, line))
{
if (new_numer_line == 30)
{
file >> firstplace >> secondplace >> thirdplace;
}
if (new_numer_line == setline)
{
file >> nr_level >> date >> nr_points;
}
new_numer_line++;
}
file.close();
}
Records::~Records()
{
}