-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSaver.h
More file actions
executable file
·32 lines (27 loc) · 912 Bytes
/
Copy pathSaver.h
File metadata and controls
executable file
·32 lines (27 loc) · 912 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
#ifndef SAVER_H
#define SAVER_H
#include <string>
#include <istream>
#include <sstream>
#include <fstream>
#include "GameEngine.h"
#include "Menu.h"
#include "Factory.h"
#include "Utils.h"
using std::string;
class Saver
{
public:
void save(GameEngine *gameEngine, std::string fileName);
GameEngine *load(std::string fileName, Menu *menu);
private:
void save(GameEngine* gameEngine, std::ofstream& outputStream);
GameEngine* load(std::istream& inputStream, Menu* menu);
void outputWall(std::ofstream& outputStream, Mosaic* mosaic);
Mosaic* generateMosiac(std::string lines[SAVE_FILE_LINES_LENGTH], int startingLine, bool& addedFirstTile, int numberOfEachTile[]);
void cleanUpFactories(Factory* factories[]);
bool isValidFactory(TileType tiles[]);
int getTileIndex(char c);
int calculateSumOfTiles(int numberOfEachTile[]);
};
#endif