31 #define ERR_NG_TC LOG_STREAM(err, log_engine_tc)
32 #define WRN_NG_TC LOG_STREAM(warn, log_engine_tc)
33 #define LOG_NG_TC LOG_STREAM(info, log_engine_tc)
34 #define DBG_NG_TC LOG_STREAM(debug, log_engine_tc)
41 , player_exists_(false)
143 DBG_NG_TC <<
"adding previous recruit: " << rec;
152 <<
"unit from " << origin <<
": "
153 <<
"type=[" << u[
"type"] <<
"] "
154 <<
"id=[" << u[
"id"] <<
"] "
155 <<
"placement=[" << u[
"placement"] <<
"] "
156 <<
"x=[" << u[
"x"] <<
"] "
157 <<
"y=[" << u[
"y"] <<
"]";
159 if(u[
"type"].empty()) {
161 <<
"when building level, skipping a unit (id=[" << u[
"id"] <<
"]) from " << origin
162 <<
" with no type information,\n"
169 const std::string&
id = u[
"id"];
174 u_tmp[
"side"] = std::to_string(
side_);
Variant for storing WML attributes.
bool blank() const
Tests for an attribute that was never set.
A config object defines a single node in a WML file, with access to child nodes.
child_itors child_range(config_key_type key)
void remove_attribute(config_key_type key)
void remove_children(config_key_type key, std::function< bool(const config &)> p={})
Removes all children with tag key for which p returns true.
std::string debug() const
const attribute_value * get(config_key_type key) const
Returns a pointer to the attribute with the given key or nullptr if it does not exist.
virtual const gamemap & map() const override
map_location starting_position(int side) const
bool empty() const
Tell if the map is of 0 size.
void add(const unit_ptr &ptr, int pos=-1)
Add a unit to the list.
std::deque< config > leader_configs_
team_builder(const config &side_cfg, team &to_build, const config &level, game_board &board, int num)
void build_team_stage_three()
Handles the third stage of team initialization (unit placement).
void handle_leader(const config &leader)
void build_team_stage_two()
Handles the second stage of team initialization ((some) unit construction).
std::set< std::string > seen_ids_
std::vector< const config * > unit_configs_
void build_team_stage_one()
Handles the first stage of team initialization (everything except unit construction).
void handle_unit(const config &u, const char *origin)
void log_step(const char *s) const
This class stores all the data for a single 'side' (in game nomenclature).
const t_string & objectives() const
void set_objectives(const t_string &new_objectives, bool silently=false)
void build(const config &cfg, const gamemap &map, int gold=default_team_gold_)
void add_recruit(const std::string &)
static const std::set< std::string > attributes
Stores the attributes recognized by [side].
recall_list_manager & recall_list()
unit_creator & allow_invalidate(bool b)
unit_creator & allow_get_village(bool b)
void add_unit(const config &cfg, const vconfig *vcfg=nullptr)
adds a unit on map without firing any events (so, usable during team construction in gamestatus)
unit_creator & allow_discover(bool b)
unit_creator & allow_show(bool b)
unit_creator & allow_rename_side(bool b)
unit_creator & allow_add_to_recall(bool b)
static unit_ptr create(const config &cfg, bool use_traits=false, const vconfig *vcfg=nullptr)
Initializes a unit from a config.
Various functions related to the creation of units (recruits, recalls, and placed units).
Standard logging facilities (interface).
std::string bool_string(const bool value)
Converts a bool value to 'true' or 'false'.
std::vector< std::string > split(const config_attribute_value &val)
Error used when game loading fails.
static lg::log_domain log_engine_tc("engine/team_construction")
static map_location::direction s