The Battle for Wesnoth  1.15.2+dev
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
savegame::loadgame Class Reference

The class for loading a savefile. More...

#include <savegame.hpp>

Public Member Functions

 loadgame (const std::shared_ptr< save_index_class > &index, const config &game_config, saved_game &gamestate)
 
virtual ~loadgame ()
 
bool load_game_ingame ()
 Load a game without providing any information. More...
 
bool load_game ()
 Load a game with pre-setting information for the load-game dialog. More...
 
bool load_multiplayer_game ()
 Loading a game from within the multiplayer-create dialog. More...
 
void set_gamestate ()
 Generate the gamestate out of the loaded game config. More...
 
load_game_metadatadata ()
 

Static Public Member Functions

static bool check_version_compatibility (const version_info &version)
 GUI Dialog sequence which confirms attempts to load saves from previous game versions. More...
 
static bool is_replay_save (const config &cfg)
 

Private Member Functions

bool show_difficulty_dialog ()
 Display the difficulty dialog. More...
 
bool check_version_compatibility ()
 Call check_version_compatibility above, using the version of this savefile. More...
 
void copy_era (config &cfg)
 Copy era information into the snapshot. More...
 

Private Attributes

const configgame_config_
 
saved_gamegamestate_
 
load_game_metadata load_data_
 Primary output information. More...
 

Detailed Description

The class for loading a savefile.

Definition at line 108 of file savegame.hpp.

Constructor & Destructor Documentation

◆ loadgame()

savegame::loadgame::loadgame ( const std::shared_ptr< save_index_class > &  index,
const config game_config,
saved_game gamestate 
)

Definition at line 82 of file savegame.cpp.

◆ ~loadgame()

virtual savegame::loadgame::~loadgame ( )
inlinevirtual

Definition at line 112 of file savegame.hpp.

Member Function Documentation

◆ check_version_compatibility() [1/2]

bool savegame::loadgame::check_version_compatibility ( const version_info version)
static

◆ check_version_compatibility() [2/2]

bool savegame::loadgame::check_version_compatibility ( )
private

Call check_version_compatibility above, using the version of this savefile.

Definition at line 226 of file savegame.cpp.

References saved_game::classification(), gamestate_, and game_classification::version.

Referenced by load_game(), load_game_ingame(), and load_multiplayer_game().

◆ copy_era()

void savegame::loadgame::copy_era ( config cfg)
private

Copy era information into the snapshot.

Definition at line 331 of file savegame.cpp.

References config::add_child(), config::child(), and preferences::era().

Referenced by load_multiplayer_game().

◆ data()

load_game_metadata& savegame::loadgame::data ( )
inline

Definition at line 127 of file savegame.hpp.

Referenced by game_launcher::load_game().

◆ is_replay_save()

static bool savegame::loadgame::is_replay_save ( const config cfg)
inlinestatic

◆ load_game()

bool savegame::loadgame::load_game ( )

◆ load_game_ingame()

bool savegame::loadgame::load_game_ingame ( )

◆ load_multiplayer_game()

bool savegame::loadgame::load_multiplayer_game ( )

◆ set_gamestate()

void savegame::loadgame::set_gamestate ( )

Generate the gamestate out of the loaded game config.

Definition at line 274 of file savegame.cpp.

References gamestate_, savegame::load_game_metadata::load_config, load_data_, and saved_game::set_data().

Referenced by game_launcher::load_game(), and load_multiplayer_game().

◆ show_difficulty_dialog()

bool savegame::loadgame::show_difficulty_dialog ( )
private

Member Data Documentation

◆ game_config_

const config& savegame::loadgame::game_config_
private

◆ gamestate_

saved_game& savegame::loadgame::gamestate_
private

Definition at line 150 of file savegame.hpp.

Referenced by check_version_compatibility(), load_game(), and set_gamestate().

◆ load_data_

load_game_metadata savegame::loadgame::load_data_
private

Primary output information.

Definition at line 152 of file savegame.hpp.

Referenced by load_game(), load_game_ingame(), load_multiplayer_game(), set_gamestate(), and show_difficulty_dialog().


The documentation for this class was generated from the following files: