25 : add_(!side[
"carryover_add"].empty() ? side[
"carryover_add"].to_bool() : side[
"add"].to_bool())
26 , current_player_(side[
"current_player"])
27 , gold_(!side[
"carryover_gold"].empty() ? side[
"carryover_gold"].to_int() : side[
"gold"].to_int())
31 , save_id_(side[
"save_id"])
32 , variables_(side.child_or_empty(
"variables"))
43 , current_player_(t.current_player())
45 , previous_recruits_(t.recruits())
47 , save_id_(t.save_id())
48 , variables_(t.variables())
60 int cfg_gold = side_cfg[
"gold"].to_int();
62 if(side_cfg[
"gold"].empty()) {
64 side_cfg[
"gold"] = cfg_gold;
68 side_cfg[
"gold"] = cfg_gold +
gold_;
70 else if(
gold_ > cfg_gold){
71 side_cfg[
"gold"] =
gold_;
81 side_cfg[
"previous_recruits"] = can_recruit_str;
98 return can_recruit_str;
105 side.append(u_cfg[
"name"].str() +
", ");
113 side[
"gold"] =
gold_;
125 , variables_(cfg.child_or_empty(
"variables"))
128 , next_scenario_(cfg[
"next_scenario"])
129 , next_underlying_unit_id_(cfg[
"next_underlying_unit_id"].to_int(0))
133 if(side[
"lost"].to_bool(
false) || !side[
"persistent"].to_bool(
true))
136 assert(from_snpashot);
159 if (it->get_save_id() ==
id) {
178 if(side_cfg[
"save_id"].empty()){
179 side_cfg[
"save_id"] = side_cfg[
"id"];
188 iside->transfer_all_gold_to(side_cfg);
189 iside->transfer_all_recalls_to(side_cfg);
190 iside->transfer_all_recruits_to(side_cfg);
216 if ( seed_value.
empty() ) {
257 if(side.get_save_id() == save_id){
child_itors child_range(const std::string &key)
void add_side(const config &cfg)
std::vector< carryover > & get_all_sides()
boost::ptr_vector< config > wml_menu_items_
config & child_or_add(const std::string &key)
Returns a reference to the first child with the given key.
void transfer_all_recalls_to(config &side_cfg)
GLfloat GLfloat GLfloat v2
GLuint const GLfloat * val
void merge_old_carryover(const carryover_info &old_carryover)
carryover * get_side(std::string save_id)
void transfer_to(config &level)
bool empty() const
Tests for an attribute that either was never set or was set to "".
Definitions for the interface to Wesnoth Markup Language (WML).
std::string get_random_seed_str() const
Variant for storing WML attributes.
const std::string & get_save_id() const
std::set< std::string > previous_recruits_
int next_underlying_unit_id_
unsigned int get_random_calls() const
void transfer_all_to(config &side_cfg)
bool has_child(const std::string &key) const
Determine whether a config has a child or not.
This class stores all the data for a single 'side' (in game nomenclature).
std::vector< config > recall_list_
GLsizei const GLfloat * value
void erase(const std::string &key)
config & add_child(const std::string &key)
void transfer_all_gold_to(config &side_cfg)
std::vector< carryover > carryover_sides_
std::string join(T const &v, const std::string &s=",")
Generates a new string joining container items in a list.
std::string current_player_
std::string next_scenario_
the scenario coming next (for campaigns)
const std::string to_string()
std::string get_recruits(bool erase=false)
void transfer_all_recruits_to(config &side_cfg)
save_id_equals(std::string val)
bool operator()(carryover &v2)
std::set< std::string > set_split(std::string const &val, const char c= ',', const int flags=REMOVE_EMPTY|STRIP_SPACES)
Splits a (comma-)separated string into a set of pieces.
bool has_attribute(const std::string &key) const
void remove_side(const std::string &id)
recall_list_manager & recall_list()
void to_config(config &cfg)
static const int default_gold_qty
void remove_attributes(T...keys)
A config object defines a single node in a WML file, with access to child nodes.
GLsizei const GLcharARB ** string