Class for replay saves (either manually or automatically). More...
#include <savegame.hpp>
Public Member Functions | |
replay_savegame (saved_game &gamestate, const compression::format compress_saves) | |
Public Member Functions inherited from savegame::savegame | |
virtual | ~savegame () |
bool | save_game_automatic (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 (const std::string &message, DIALOG_TYPE dialog_type) |
Save a game interactively through the savegame dialog. More... | |
const std::string & | filename () const |
std::string | create_filename () const |
Build the filename according to the specific savegame's needs. More... | |
std::string | create_filename (unsigned int turn_number) const |
Build the filename for the specified turn. More... | |
Private Member Functions | |
virtual std::string | create_initial_filename (unsigned int turn_number) const override |
Create a filename for automatic saves. More... | |
void | write_game (config_writer &out) override |
Writing the savegame config to a file. More... | |
Additional Inherited Members | |
Public Types inherited from savegame::savegame | |
enum | DIALOG_TYPE { YES_NO , OK_CANCEL } |
Protected Member Functions inherited from savegame::savegame | |
savegame (saved_game &gamestate, const compression::format compress_saves, const std::string &title="Save") | |
The only constructor of savegame. More... | |
bool | save_game (const std::string &filename="") |
Save a game without any further user interaction. More... | |
bool | check_filename (const std::string &filename) |
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 |
const saved_game & | gamestate () const |
void | before_save () |
If there needs to be some data fiddling before saving the game, this is the place to go. More... | |
Protected Attributes inherited from savegame::savegame | |
std::string | filename_ |
Filename of the savegame file on disk. More... | |
std::string | title_ |
Title of the savegame dialog. More... | |
std::shared_ptr< save_index_class > | save_index_manager_ |
Will (at the time of writing) be save_index_class::default_saves_dir(). More... | |
Class for replay saves (either manually or automatically).
Definition at line 267 of file savegame.hpp.
savegame::replay_savegame::replay_savegame | ( | saved_game & | gamestate, |
const compression::format | compress_saves | ||
) |
Definition at line 568 of file savegame.cpp.
|
overrideprivatevirtual |
Create a filename for automatic saves.
Implements savegame::savegame.
Definition at line 573 of file savegame.cpp.
References _(), saved_game::classification(), savegame::savegame::gamestate(), game_classification::label, and t.
|
overrideprivatevirtual |
Writing the savegame config to a file.
Reimplemented from savegame::savegame.
Definition at line 583 of file savegame.cpp.
References config_writer::close_child(), savegame::savegame::gamestate(), saved_game::get_replay(), config_writer::open_child(), replay_recorder_base::write(), saved_game::write_carryover(), config_writer::write_child(), and savegame::savegame::write_game().