32 #define ERR_NG_TC LOG_STREAM(err, log_engine_tc) 33 #define WRN_NG_TC LOG_STREAM(warn, log_engine_tc) 34 #define LOG_NG_TC LOG_STREAM(info, log_engine_tc) 35 #define DBG_NG_TC LOG_STREAM(debug, log_engine_tc) 42 , player_exists_(false)
84 LOG_NG_TC <<
"team " <<
side_ <<
" construction: " << s << std::endl;
145 DBG_NG_TC <<
"adding previous recruit: " << rec <<
'\n';
154 <<
"unit from " << origin <<
": " 155 <<
"type=[" << u[
"type"] <<
"] " 156 <<
"id=[" << u[
"id"] <<
"] " 157 <<
"placement=[" << u[
"placement"] <<
"] " 158 <<
"x=[" << u[
"x"] <<
"] " 159 <<
"y=[" << u[
"y"] <<
"]" 162 if(u[
"type"].empty()) {
164 <<
"when building level, skipping a unit (id=[" << u[
"id"] <<
"]) from " << origin
165 <<
" with no type information,\n" 172 const std::string&
id = u[
"id"];
177 u_tmp[
"side"] = std::to_string(
side_);
unit_creator & allow_rename_side(bool b)
std::deque< config > leader_configs_
void set_objectives(const t_string &new_objectives, bool silently=false)
unit_creator & allow_invalidate(bool b)
unit_creator & allow_show(bool b)
Variant for storing WML attributes.
Error used when game loading fails.
static const std::set< std::string > attributes
Stores the attributes recognized by [side].
child_itors child_range(config_key_type key)
unit_creator & allow_discover(bool b)
team_builder(const config &side_cfg, team &to_build, const config &level, game_board &board, int num)
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
void build_team_stage_two()
Handles the second stage of team initialization (unit placement).
void build(const config &cfg, const gamemap &map, int gold=default_team_gold_)
void add_recruit(const std::string &)
void remove_attribute(config_key_type key)
std::vector< const config * > unit_configs_
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.
This class stores all the data for a single 'side' (in game nomenclature).
bool empty() const
Tell if the map is of 0 size.
static lg::log_domain log_engine_tc("engine/team_construction")
bool blank() const
Tests for an attribute that was never set.
void handle_leader(const config &leader)
void log_step(const char *s) const
const char * what() const noexcept
void build_team_stage_one()
Handles the first stage of team initialization (everything except unit placement).
Various functions related to the creation of units (recruits, recalls, and placed units)...
unit_creator & allow_get_village(bool b)
static map_location::DIRECTION s
void handle_unit(const config &u, const char *origin)
const t_string & objectives() const
std::string bool_string(const bool value)
Converts a bool value to 'true' or 'false'.
map_location starting_position(int side) const
std::set< std::string > seen_ids_
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) ...
std::vector< std::string > split(const config_attribute_value &val)
void add(const unit_ptr &ptr, int pos=-1)
Add a unit to the list.
Standard logging facilities (interface).
recall_list_manager & recall_list()
A config object defines a single node in a WML file, with access to child nodes.
std::string debug() const