1 /* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */
2 
3 #ifndef _LUA_LOAD_SAVE_HANDLER_H
4 #define _LUA_LOAD_SAVE_HANDLER_H
5 
6 #include "LoadSaveHandler.h"
7 
8 class IArchive;
9 
10 #ifndef zipFile
11 	// might be defined through zip.h already
12 	typedef void* zipFile;
13 #endif
14 
15 
16 class CLuaLoadSaveHandler : public ILoadSaveHandler
17 {
18 public:
19 	CLuaLoadSaveHandler();
20 	~CLuaLoadSaveHandler();
21 
22 	void SaveGame(const std::string& file);
23 	void LoadGameStartInfo(const std::string& file);
24 	void LoadGame();
25 
26 protected:
27 	void SaveEventClients(); // Lua
28 	void SaveGameStartInfo();
29 	void SaveAIData();
30 	void SaveHeightmap();
31 	void SaveEntireFile(const char* file, const char* what, const void* data, int size, bool throwOnError = false);
32 	void LoadEventClients();
33 	void LoadAIData();
34 	void LoadHeightmap();
35 	std::string LoadEntireFile(const std::string& file);
36 
37 	std::string filename;
38 	zipFile savefile;
39 	IArchive* loadfile;
40 };
41 
42 #endif // _LUA_LOAD_SAVE_HANDLER_H
43