-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRecord.h
36 lines (29 loc) · 904 Bytes
/
Record.h
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
#ifndef RECORD_H_INCLUDED
#define RECORD_H_INCLUDED
#include <iostream>
#include <fstream>
#include <vector>
#include <sstream>
#include "Item.h"
#include "Monster.h"
#include "NPC.h"
#include "Player.h"
using namespace std;
/* This is the record system. Get the information of the */
/* player and rooms then save them to (a) file(s). Notice */
/* that using pass by reference can prevent sending the */
/* whole vector to the function. */
class Record
{
private:
void savePlayer(Player*, ofstream&);
void saveRooms(vector<Room>&, ofstream&);
void loadPlayer(Player*, ifstream&,vector<Room>&);
void loadRooms(vector<Room>&, ifstream&);
public:
Record();
void saveToFile(Player*, vector<Room>&);
void loadFromFile(string,Player*, vector<Room>&);
bool checkFile(string);
};
#endif // RECORD_H_INCLUDED