The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 (CVideo &video, const config &game_config, saved_game &gamestate)
 
virtual ~loadgame ()
 
bool load_game ()
 Load a game without providing any information. More...
 
bool load_game (const std::string &filename, const bool show_replay, const bool cancel_orders, const bool select_difficulty, const std::string &difficulty, bool skip_version_check)
 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...
 
bool show_replay () const
 
bool cancel_orders () const
 
const std::stringfilename () const
 

Static Public Member Functions

static bool check_version_compatibility (const version_info &version, CVideo &video)
 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

void show_dialog ()
 Display the load-game dialog. More...
 
void 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_
 
CVideovideo_
 
saved_gamegamestate_
 
std::string filename_
 Primary output information. More...
 
std::string difficulty_
 Name of the savefile to be loaded. More...
 
config load_config_
 The difficulty the save is meant to be loaded with. More...
 
bool show_replay_
 Config information of the savefile to be loaded. More...
 
bool cancel_orders_
 State of the "show_replay" checkbox in the load-game dialog. More...
 
bool select_difficulty_
 State of the "cancel_orders" checkbox in the load-game dialog. More...
 
config summary_
 State of the "change_difficulty" checkbox in the load-game dialog. More...
 

Detailed Description

The class for loading a savefile.

Definition at line 36 of file savegame.hpp.

Constructor & Destructor Documentation

savegame::loadgame::loadgame ( CVideo video,
const config game_config,
saved_game gamestate 
)

Definition at line 84 of file savegame.cpp.

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

Definition at line 40 of file savegame.hpp.

Member Function Documentation

bool savegame::loadgame::cancel_orders ( ) const
inline

Definition at line 62 of file savegame.hpp.

References cancel_orders_.

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

bool savegame::loadgame::check_version_compatibility ( const version_info version,
CVideo video 
)
static
bool savegame::loadgame::check_version_compatibility ( )
private

Call check_version_compatibility above, using the version of this savefile.

Definition at line 236 of file savegame.cpp.

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

Referenced by load_game(), and load_multiplayer_game().

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

Copy era information into the snapshot.

Definition at line 327 of file savegame.cpp.

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

Referenced by load_multiplayer_game().

const std::string& savegame::loadgame::filename ( ) const
inline

Definition at line 63 of file savegame.hpp.

References filename_.

Referenced by load_game().

static bool savegame::loadgame::is_replay_save ( const config cfg)
inlinestatic
bool savegame::loadgame::load_game ( )
bool savegame::loadgame::load_game ( const std::string filename,
const bool  show_replay,
const bool  cancel_orders,
const bool  select_difficulty,
const std::string difficulty,
bool  skip_version_check 
)
bool savegame::loadgame::load_multiplayer_game ( )
void savegame::loadgame::set_gamestate ( )

Generate the gamestate out of the loaded game config.

Definition at line 284 of file savegame.cpp.

References gamestate_, load_config_, and saved_game::set_data().

Referenced by game_launcher::load_game().

void savegame::loadgame::show_dialog ( )
private
void savegame::loadgame::show_difficulty_dialog ( )
private
bool savegame::loadgame::show_replay ( ) const
inline

Definition at line 61 of file savegame.hpp.

References show_replay_.

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

Member Data Documentation

bool savegame::loadgame::cancel_orders_
private

State of the "show_replay" checkbox in the load-game dialog.

Definition at line 91 of file savegame.hpp.

Referenced by cancel_orders(), load_game(), and show_dialog().

std::string savegame::loadgame::difficulty_
private

Name of the savefile to be loaded.

Definition at line 88 of file savegame.hpp.

Referenced by load_game(), and show_difficulty_dialog().

std::string savegame::loadgame::filename_
private

Primary output information.

Definition at line 87 of file savegame.hpp.

Referenced by filename(), load_game(), load_multiplayer_game(), and show_dialog().

const config& savegame::loadgame::game_config_
private

Definition at line 83 of file savegame.hpp.

Referenced by show_dialog(), and show_difficulty_dialog().

saved_game& savegame::loadgame::gamestate_
private
config savegame::loadgame::load_config_
private

The difficulty the save is meant to be loaded with.

Definition at line 89 of file savegame.hpp.

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

bool savegame::loadgame::select_difficulty_
private

State of the "cancel_orders" checkbox in the load-game dialog.

Definition at line 92 of file savegame.hpp.

Referenced by load_game(), and show_dialog().

bool savegame::loadgame::show_replay_
private

Config information of the savefile to be loaded.

Definition at line 90 of file savegame.hpp.

Referenced by load_game(), show_dialog(), and show_replay().

config savegame::loadgame::summary_
private

State of the "change_difficulty" checkbox in the load-game dialog.

Definition at line 93 of file savegame.hpp.

Referenced by load_multiplayer_game(), show_dialog(), and show_difficulty_dialog().

CVideo& savegame::loadgame::video_
private

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