The Battle for Wesnoth  1.19.5+dev
Public Member Functions | Private Attributes | List of all members
carryover_info Class Reference

#include <carryover.hpp>

Public Member Functions

 carryover_info ()
 
 carryover_info (const config &cfg, bool from_snapshot=false)
 Turns config from a loaded savegame into carryover_info. More...
 
carryoverget_side (const std::string &save_id)
 
std::vector< carryover > & get_all_sides ()
 
void add_side (const config &cfg)
 
void add_side (const team &t, const int gold, const bool add)
 
void remove_side (const std::string &id)
 
void transfer_all_to (config &side_cfg)
 
void transfer_to (config &level)
 
void set_variables (const config &vars)
 
const configget_variables () const
 
const randomness::mt_rngrng () const
 
randomness::mt_rngrng ()
 
const std::string & next_scenario () const
 
const config to_config ()
 
void merge_old_carryover (const carryover_info &old_carryover)
 

Private Attributes

std::vector< carryovercarryover_sides_
 
config variables_
 
randomness::mt_rng rng_
 
std::vector< configwml_menu_items_
 
std::string next_scenario_
 the scenario coming next (for campaigns) More...
 
int next_underlying_unit_id_
 

Detailed Description

Definition at line 61 of file carryover.hpp.

Constructor & Destructor Documentation

◆ carryover_info() [1/2]

carryover_info::carryover_info ( )
inline

Definition at line 64 of file carryover.hpp.

◆ carryover_info() [2/2]

carryover_info::carryover_info ( const config cfg,
bool  from_snapshot = false 
)
explicit

Turns config from a loaded savegame into carryover_info.

Parameters
cfgthe config to use
from_snapshottrue if cfg is a [snapshot], false if cfg is [carryover_sides(_start)]

Definition at line 110 of file carryover.cpp.

References carryover_sides_, config::child_range(), ERR_NG, and wml_menu_items_.

Member Function Documentation

◆ add_side() [1/2]

void carryover_info::add_side ( const config cfg)

Definition at line 142 of file carryover.cpp.

References carryover_sides_.

◆ add_side() [2/2]

void carryover_info::add_side ( const team t,
const int  gold,
const bool  add 
)

◆ get_all_sides()

std::vector< carryover > & carryover_info::get_all_sides ( )

Definition at line 138 of file carryover.cpp.

References carryover_sides_.

◆ get_side()

carryover * carryover_info::get_side ( const std::string &  save_id)

Definition at line 244 of file carryover.cpp.

References carryover_sides_.

◆ get_variables()

const config& carryover_info::get_variables ( ) const
inline

Definition at line 90 of file carryover.hpp.

References variables_.

◆ merge_old_carryover()

void carryover_info::merge_old_carryover ( const carryover_info old_carryover)

Definition at line 254 of file carryover.cpp.

References carryover_sides_, and carryover::get_save_id().

Referenced by saved_game::convert_to_start_save().

◆ next_scenario()

const std::string& carryover_info::next_scenario ( ) const
inline

Definition at line 95 of file carryover.hpp.

References next_scenario_.

◆ remove_side()

void carryover_info::remove_side ( const std::string &  id)

Definition at line 146 of file carryover.cpp.

References carryover_sides_.

◆ rng() [1/2]

randomness::mt_rng& carryover_info::rng ( )
inline

Definition at line 93 of file carryover.hpp.

References rng_.

◆ rng() [2/2]

const randomness::mt_rng& carryover_info::rng ( ) const
inline

Definition at line 92 of file carryover.hpp.

References rng_.

Referenced by saved_game::convert_to_start_save().

◆ set_variables()

void carryover_info::set_variables ( const config vars)
inline

Definition at line 89 of file carryover.hpp.

References variables_.

◆ to_config()

const config carryover_info::to_config ( )

◆ transfer_all_to()

void carryover_info::transfer_all_to ( config side_cfg)

◆ transfer_to()

void carryover_info::transfer_to ( config level)

Member Data Documentation

◆ carryover_sides_

std::vector<carryover> carryover_info::carryover_sides_
private

◆ next_scenario_

std::string carryover_info::next_scenario_
private

the scenario coming next (for campaigns)

Definition at line 105 of file carryover.hpp.

Referenced by next_scenario(), to_config(), and transfer_to().

◆ next_underlying_unit_id_

int carryover_info::next_underlying_unit_id_
private

Definition at line 106 of file carryover.hpp.

Referenced by to_config(), and transfer_to().

◆ rng_

randomness::mt_rng carryover_info::rng_
private

Definition at line 103 of file carryover.hpp.

Referenced by rng(), to_config(), and transfer_to().

◆ variables_

config carryover_info::variables_
private

Definition at line 102 of file carryover.hpp.

Referenced by get_variables(), set_variables(), to_config(), and transfer_to().

◆ wml_menu_items_

std::vector<config> carryover_info::wml_menu_items_
private

Definition at line 104 of file carryover.hpp.

Referenced by carryover_info(), to_config(), and transfer_to().


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