Class for "normal" midgame saves. More...
#include <savegame.hpp>
Public Member Functions | |
ingame_savegame (saved_game &gamestate, game_display &gui, const compression::format compress_saves) | |
![]() | |
virtual | ~savegame () |
bool | save_game_automatic (CVideo &video, bool ask_for_overwrite=false, const std::string &filename="") |
Saves a game without user interaction, unless the file exists and it should be asked to overwrite it. More... | |
bool | save_game_interactive (CVideo &video, const std::string &message, gui::DIALOG_TYPE dialog_type) |
Save a game interactively through the savegame dialog. More... | |
const std::string & | filename () const |
Protected Attributes | |
game_display & | gui_ |
Private Member Functions | |
virtual void | create_filename () |
Create a filename for automatic saves. More... | |
void | write_game (config_writer &out) |
Writing the savegame config to a file. More... | |
Additional Inherited Members | |
![]() | |
savegame (saved_game &gamestate, const compression::format compress_saves, const std::string &title="Save") | |
The only constructor of savegame. More... | |
bool | save_game (CVideo *video=nullptr, const std::string &filename="") |
Save a game without any further user interaction. More... | |
void | set_filename (std::string filename) |
Sets the filename and removes invalid characters. More... | |
bool | check_filename (const std::string &filename, CVideo &video) |
Check, if the filename contains illegal constructs like ".gz". More... | |
void | set_error_message (const std::string &error_message) |
Customize the standard error message. More... | |
const std::string & | title () |
const saved_game & | gamestate () |
void | before_save () |
If there needs to be some data fiddling before saving the game, this is the place to go. More... | |
Class for "normal" midgame saves.
The additional members are needed for creating the snapshot information.
Definition at line 188 of file savegame.hpp.
savegame::ingame_savegame::ingame_savegame | ( | saved_game & | gamestate, |
game_display & | gui, | ||
const compression::format | compress_saves | ||
) |
Definition at line 633 of file savegame.cpp.
|
privatevirtual |
Create a filename for automatic saves.
Reimplemented from savegame::savegame.
Reimplemented in savegame::autosave_savegame.
Definition at line 640 of file savegame.cpp.
References _(), resources::classification, savegame::savegame::gamestate(), and savegame::savegame::set_filename().
|
privatevirtual |
Writing the savegame config to a file.
Reimplemented from savegame::savegame.
Definition at line 646 of file savegame.cpp.
References config_writer::close_child(), savegame::savegame::gamestate(), saved_game::get_replay(), log_scope, config_writer::open_child(), replay_recorder_base::write(), saved_game::write_carryover(), config_writer::write_child(), and savegame::savegame::write_game().
|
protected |
Definition at line 202 of file savegame.hpp.
Referenced by savegame::autosave_savegame::autosave().