Class for writing a config out to a file in pieces.
A config object defines a single node in a WML file, with access to child nodes.
game_classification & classification()
const config & get_starting_point() const
void set_skip_story(bool skip_story)
saved_game & operator=(const saved_game &other)=delete
bool is_mid_game_save() const
bool is_start_of_scenario() const
void set_random_seed()
sets the random seed if that didn't already happen.
const statistics_record::campaign_stats_t & statistics() const
config replay_start_
snapshot made before the start event.
void swap(saved_game &other)
void write_config(config_writer &out) const
writes the config information into a stream (file)
void expand_scenario()
copies the content of a [scenario] with the correct id attribute from the game config into this objec...
const config & replay_start() const
void expand_mp_options()
adds values of [option]s into [carryover_sides_start][variables] so that they are applied in the next...
void set_carryover_sides_start(config carryover_sides_start)
starting_point starting_point_type_
std::string get_scenario_id() const
static void post_scenario_generation(const config &old_scenario, config &generated_scenario)
copies attributes & tags from the 'outer' [scenario] to the scenario that is generated by scenario_ge...
replay_recorder_base replay_data_
void load_non_scenario(const std::string &type, const std::string &id, size_t pos)
helper for expand_mp_events();
const replay_recorder_base & get_replay() const
void update_label()
sets classification().label to the correct value.
mp_game_settings & mp_settings()
Multiplayer parameters for this game.
statistics_record::campaign_stats_t statistics_
void set_scenario(config scenario)
bool has_carryover_expanded_
static void expand_map_file(config &scenario)
reads scenario["map_file"]
const game_classification & classification() const
config & get_starting_point()
config starting_point_
The starting pos where the (non replay) game will be started from.
const config & get_replay_starting_point()
void check_require_scenario()
Add addon_id information if needed.
void write_starting_point(config_writer &out) const
void expand_mp_events()
adds [event]s from [era] and [modification] into this scenario does NOT expand [option]s because vari...
config carryover_
depends on has_carryover_expanded_: if true: The carryover information for all sides from the previou...
void expand_random_scenario()
takes care of generate_map=, generate_scenario=, map= attributes This should be called before expandi...
mp_game_settings mp_settings_
void expand_carryover()
merges [carryover_sides_start] into [scenario] and saves the rest into [carryover_sides] Removes [car...
const mp_game_settings & mp_settings() const
@ SNAPSHOT
We have a [snapshot] (mid-game-savefile).
@ SCENARIO
We have a [scenario] (start-of-scenario) savefile.
@ NONE
There is no scenario stating pos data (start-of-scenario).
@ INVALID
We failed to get a starting pos in expand_scenario.
statistics_record::campaign_stats_t & statistics()
void convert_to_start_save()
converts a normal savegame form the end of a scenaio to a start-of-scenario savefile for the next sce...
void set_defaults()
does some post loading stuff must be used before passing the data to connect_engine
void write_general_info(config_writer &out) const
game_classification classification_
some general information of the game that doesn't change during the game
replay_recorder_base & get_replay()
void set_data(config &cfg)
destroys the passed config.
config & set_snapshot(config snapshot)
void write_carryover(config_writer &out) const
bool skip_story() const
Whether to play [story] tags.
Definitions for the interface to Wesnoth Markup Language (WML).
void swap(saved_game &lhs, saved_game &rhs)
Implement non-member swap function for std::swap (calls saved_game::swap).