ScummVM API documentation
save_game.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef NUVIE_SAVE_SAVE_GAME_H
23 #define NUVIE_SAVE_SAVE_GAME_H
24 
25 #define SAVE_VERSION_MAJOR 1
26 #define SAVE_VERSION_MINOR 0
27 #define SAVE_VERSION (SAVE_VERSION_MAJOR * 256 + SAVE_VERSION_MINOR)
28 
29 #include "ultima/shared/std/string.h"
30 #include "ultima/nuvie/files/nuvie_io_file.h"
31 
32 namespace Ultima {
33 namespace Nuvie {
34 
35 class Configuration;
36 class ActorManager;
37 class ObjManager;
38 class Actor;
39 class Map;
40 class NuvieIO;
41 class NuvieIOFileWrite;
42 
43 class SaveGame {
44 private:
45  Configuration *config;
46  NuvieIOBuffer objlist;
47 protected:
48  bool load_objlist();
49  bool save_objlist();
50 
51  void update_objlist_for_new_game();
52  void update_objlist_for_new_game_u6();
53  void update_objlist_for_new_game_se();
54  void update_objlist_for_new_game_md();
55 public:
56  SaveGame(Configuration *cfg);
57  ~SaveGame();
58 
59  void init(ObjManager *obj_manager);
60 
64  bool load_new();
65 
69  bool load_original();
70 
74  bool transfer_character();
75 
79  bool load(const Common::String &filename);
80 
81  bool check_version(NuvieIOFileRead *loadfile, uint16 gameType);
82 
83  bool save(const Common::String &filename, const Common::String &save_description, bool isAutosave);
84 };
85 
86 } // End of namespace Nuvie
87 } // End of namespace Ultima
88 
89 #endif
Definition: str.h:59
Definition: configuration.h:61
Definition: save_game.h:43
Definition: detection.h:27
bool load(const Common::String &filename)
Definition: obj_manager.h:75
Definition: nuvie_io.h:106
Definition: nuvie_io_file.h:44