The Battle for Wesnoth  1.15.0-dev
Public Member Functions | Private Member Functions | Private Attributes | List of all members
carryover Class Reference

#include <carryover.hpp>

Public Member Functions

 carryover ()
 
 carryover (const config &side)
 
 carryover (const team &t, const int gold, const bool add)
 
 ~carryover ()
 
const std::string & get_save_id () const
 
void transfer_all_gold_to (config &side_cfg)
 
void transfer_all_recruits_to (config &side_cfg)
 
void transfer_all_recalls_to (config &side_cfg)
 
const std::string to_string ()
 
void to_config (config &cfg)
 

Private Member Functions

std::string get_recruits (bool erase=false)
 

Private Attributes

bool add_
 
std::string current_player_
 
int gold_
 
std::set< std::string > previous_recruits_
 
std::vector< configrecall_list_
 
std::string save_id_
 
config variables_
 

Detailed Description

Definition at line 26 of file carryover.hpp.

Constructor & Destructor Documentation

◆ carryover() [1/3]

carryover::carryover ( )
inline

Definition at line 29 of file carryover.hpp.

References t.

◆ carryover() [2/3]

carryover::carryover ( const config side)
explicit

Definition at line 27 of file carryover.cpp.

References config::child_range(), recall_list_, and config::remove_attributes().

◆ carryover() [3/3]

carryover::carryover ( const team t,
const int  gold,
const bool  add 
)

Definition at line 44 of file carryover.cpp.

References team::recall_list(), and recall_list_.

◆ ~carryover()

carryover::~carryover ( )
inline

Definition at line 40 of file carryover.hpp.

Member Function Documentation

◆ get_recruits()

std::string carryover::get_recruits ( bool  erase = false)
private

Definition at line 94 of file carryover.cpp.

References utils::join(), and previous_recruits_.

Referenced by to_config(), and to_string().

◆ get_save_id()

const std::string& carryover::get_save_id ( ) const
inline

◆ to_config()

void carryover::to_config ( config cfg)

◆ to_string()

const std::string carryover::to_string ( )

Definition at line 104 of file carryover.cpp.

References get_recruits(), gold_, recall_list_, and save_id_.

Referenced by get_save_id().

◆ transfer_all_gold_to()

void carryover::transfer_all_gold_to ( config side_cfg)

Definition at line 61 of file carryover.cpp.

References add_, config::child_or_add(), config::clear(), default_gold_qty, gold_, config::swap(), and variables_.

Referenced by get_save_id().

◆ transfer_all_recalls_to()

void carryover::transfer_all_recalls_to ( config side_cfg)

Definition at line 87 of file carryover.cpp.

References config::add_child(), config::clear(), and recall_list_.

Referenced by get_save_id().

◆ transfer_all_recruits_to()

void carryover::transfer_all_recruits_to ( config side_cfg)

Definition at line 81 of file carryover.cpp.

References utils::join(), and previous_recruits_.

Referenced by get_save_id().

Member Data Documentation

◆ add_

bool carryover::add_
private

Definition at line 49 of file carryover.hpp.

Referenced by to_config(), and transfer_all_gold_to().

◆ current_player_

std::string carryover::current_player_
private

Definition at line 50 of file carryover.hpp.

Referenced by to_config().

◆ gold_

int carryover::gold_
private

Definition at line 51 of file carryover.hpp.

Referenced by to_config(), to_string(), and transfer_all_gold_to().

◆ previous_recruits_

std::set<std::string> carryover::previous_recruits_
private

Definition at line 52 of file carryover.hpp.

Referenced by get_recruits(), and transfer_all_recruits_to().

◆ recall_list_

std::vector<config> carryover::recall_list_
private

Definition at line 56 of file carryover.hpp.

Referenced by carryover(), to_config(), to_string(), and transfer_all_recalls_to().

◆ save_id_

std::string carryover::save_id_
private

Definition at line 57 of file carryover.hpp.

Referenced by get_save_id(), to_config(), and to_string().

◆ variables_

config carryover::variables_
private

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