The Battle for Wesnoth  1.19.5+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, 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 game_config_viewgame_config_
 
saved_gamegamestate_
 
load_game_metadata load_data_
 Primary output information. More...
 

Detailed Description

The class for loading a savefile.

Definition at line 100 of file savegame.hpp.

Constructor & Destructor Documentation

◆ loadgame()

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

Definition at line 77 of file savegame.cpp.

◆ ~loadgame()

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

Definition at line 104 of file savegame.hpp.

Member Function Documentation

◆ check_version_compatibility() [1/2]

bool savegame::loadgame::check_version_compatibility ( )
private

Call check_version_compatibility above, using the version of this savefile.

Definition at line 219 of file savegame.cpp.

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

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

◆ check_version_compatibility() [2/2]

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

◆ copy_era()

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

Copy era information into the snapshot.

Definition at line 330 of file savegame.cpp.

References config::optional_child().

Referenced by load_multiplayer_game().

◆ data()

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

Definition at line 119 of file savegame.hpp.

References load_data_.

◆ 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 276 of file savegame.cpp.

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

Referenced by load_multiplayer_game().

◆ show_difficulty_dialog()

bool savegame::loadgame::show_difficulty_dialog ( )
private

Member Data Documentation

◆ game_config_

const game_config_view& savegame::loadgame::game_config_
private

◆ gamestate_

saved_game& savegame::loadgame::gamestate_
private

Definition at line 142 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 144 of file savegame.hpp.

Referenced by data(), 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: