#include <teambuilder.hpp>
Public Member Functions | |
team_builder (const config &side_cfg, team &to_build, const config &level, game_board &board, int num) | |
team_builder (const team_builder &)=delete | |
Very important! Delete copy constructor and declare a move constructor. More... | |
team_builder (team_builder &&)=default | |
void | build_team_stage_one () |
Handles the first stage of team initialization (everything except unit construction). More... | |
void | build_team_stage_two () |
Handles the second stage of team initialization ((some) unit construction). More... | |
void | build_team_stage_three () |
Handles the third stage of team initialization (unit placement). More... | |
Private Member Functions | |
void | log_step (const char *s) const |
void | init () |
void | gold () |
void | new_team () |
void | objectives () |
void | previous_recruits () |
void | handle_unit (const config &u, const char *origin) |
void | handle_leader (const config &leader) |
void | leader () |
void | prepare_units () |
void | place_units () |
Private Attributes | |
int | gold_info_ngold_ |
std::deque< config > | leader_configs_ |
const config & | level_ |
game_board & | board_ |
bool | player_exists_ |
std::set< std::string > | seen_ids_ |
int | side_ |
const config & | side_cfg_ |
team & | team_ |
std::vector< const config * > | unit_configs_ |
Definition at line 28 of file teambuilder.hpp.
team_builder::team_builder | ( | const config & | side_cfg, |
team & | to_build, | ||
const config & | level, | ||
game_board & | board, | ||
int | num | ||
) |
Definition at line 36 of file teambuilder.cpp.
|
delete |
Very important! Delete copy constructor and declare a move constructor.
may hold a pointer to a config object stored in unit_configs_
. In that case, if a copy happens (such as when doing in-place construction that requires the vector be resized), these pointers will become invalid and lead to a crash. leader_configs_
|
default |
void team_builder::build_team_stage_one | ( | ) |
Handles the first stage of team initialization (everything except unit construction).
Definition at line 50 of file teambuilder.cpp.
References gold(), init(), new_team(), objectives(), and previous_recruits().
void team_builder::build_team_stage_three | ( | ) |
Handles the third stage of team initialization (unit placement).
Definition at line 78 of file teambuilder.cpp.
References place_units().
void team_builder::build_team_stage_two | ( | ) |
Handles the second stage of team initialization ((some) unit construction).
Definition at line 69 of file teambuilder.cpp.
References leader(), and prepare_units().
|
private |
Definition at line 111 of file teambuilder.cpp.
References DBG_NG_TC, gold_info_ngold_, log_step(), and side_cfg_.
Referenced by build_team_stage_one().
|
private |
Definition at line 186 of file teambuilder.cpp.
References team::attributes, config_attribute_value::blank(), handle_unit(), leader(), leader_configs_, config::remove_attribute(), and config::remove_children().
Referenced by leader().
|
private |
Definition at line 149 of file teambuilder.cpp.
References recall_list_manager::add(), unit::create(), DBG_NG_TC, config::debug(), team::recall_list(), seen_ids_, side_, side_cfg_, team_, unit_configs_, and WRN_NG_TC.
Referenced by handle_leader(), and prepare_units().
|
private |
Definition at line 90 of file teambuilder.cpp.
References board_, utils::bool_string(), DBG_NG_TC, gamemap_base::empty(), ERR_NG_TC, log_step(), game_board::map(), player_exists_, seen_ids_, side_, side_cfg_, and unit_configs_.
Referenced by build_team_stage_one().
|
private |
Definition at line 215 of file teambuilder.cpp.
References config::child_range(), handle_leader(), log_step(), and side_cfg_.
Referenced by build_team_stage_two(), and handle_leader().
|
private |
Definition at line 85 of file teambuilder.cpp.
References LOG_NG_TC, s, and side_.
Referenced by gold(), init(), leader(), new_team(), objectives(), place_units(), and previous_recruits().
|
private |
Definition at line 120 of file teambuilder.cpp.
References board_, team::build(), gold_info_ngold_, log_step(), game_board::map(), side_cfg_, and team_.
Referenced by build_team_stage_one().
|
private |
Definition at line 126 of file teambuilder.cpp.
References t_string::empty(), level_, log_step(), team::objectives(), team::set_objectives(), and team_.
Referenced by build_team_stage_one().
|
private |
Definition at line 247 of file teambuilder.cpp.
References unit_creator::add_unit(), unit_creator::allow_add_to_recall(), unit_creator::allow_discover(), unit_creator::allow_get_village(), unit_creator::allow_invalidate(), unit_creator::allow_rename_side(), unit_creator::allow_show(), board_, e, ERR_NG_TC, log_step(), game_board::map(), side_, gamemap_base::starting_position(), team_, and unit_configs_.
Referenced by build_team_stage_three().
|
private |
Definition at line 233 of file teambuilder.cpp.
References config::child_range(), handle_unit(), and side_cfg_.
Referenced by build_team_stage_two().
|
private |
Definition at line 137 of file teambuilder.cpp.
References team::add_recruit(), DBG_NG_TC, config::get(), log_step(), side_cfg_, utils::split(), and team_.
Referenced by build_team_stage_one().
|
private |
Definition at line 56 of file teambuilder.hpp.
Referenced by init(), new_team(), and place_units().
|
private |
Definition at line 52 of file teambuilder.hpp.
Referenced by gold(), and new_team().
|
private |
Definition at line 53 of file teambuilder.hpp.
Referenced by handle_leader().
|
private |
Definition at line 55 of file teambuilder.hpp.
Referenced by objectives().
|
private |
Definition at line 58 of file teambuilder.hpp.
Referenced by init().
|
private |
Definition at line 59 of file teambuilder.hpp.
Referenced by handle_unit(), and init().
|
private |
Definition at line 60 of file teambuilder.hpp.
Referenced by handle_unit(), init(), log_step(), and place_units().
|
private |
Definition at line 61 of file teambuilder.hpp.
Referenced by gold(), handle_unit(), init(), leader(), new_team(), prepare_units(), and previous_recruits().
|
private |
Definition at line 62 of file teambuilder.hpp.
Referenced by handle_unit(), new_team(), objectives(), place_units(), and previous_recruits().
|
private |
Definition at line 63 of file teambuilder.hpp.
Referenced by handle_unit(), init(), and place_units().