#include <unit_creator.hpp>
Public Member Functions | |
unit_creator (team &tm, const map_location &start_pos, game_board *board=nullptr) | |
unit_creator & | allow_show (bool b) |
unit_creator & | allow_get_village (bool b) |
unit_creator & | allow_rename_side (bool b) |
unit_creator & | allow_invalidate (bool b) |
unit_creator & | allow_discover (bool b) |
unit_creator & | allow_add_to_recall (bool b) |
map_location | find_location (const config &cfg, const unit *pass_check=nullptr) |
finds a suitable location for unit More... | |
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) More... | |
Private Member Functions | |
void | post_create (const map_location &loc, const unit &new_unit, bool anim) |
Private Attributes | |
bool | add_to_recall_ |
bool | discover_ |
bool | get_village_ |
bool | invalidate_ |
bool | rename_side_ |
bool | show_ |
const map_location | start_pos_ |
team & | team_ |
game_board * | board_ |
Definition at line 31 of file unit_creator.hpp.
unit_creator::unit_creator | ( | team & | tm, |
const map_location & | start_pos, | ||
game_board * | board = nullptr |
||
) |
Definition at line 50 of file unit_creator.cpp.
adds a unit on map without firing any events (so, usable during team construction in gamestatus)
Definition at line 158 of file unit_creator.cpp.
References recall_list_manager::add(), add_to_recall_, board_, DBG_NG, preferences::encountered_units(), recall_list_manager::erase_if_matches_id(), unit_map::find(), recall_list_manager::find_if_matches_id(), find_location(), LOG_NG, post_create(), team::recall_list(), config::remove_attribute(), unit_map::replace(), team::side(), team_, game_board::unit_id_manager(), game_board::units(), and map_location::valid().
Referenced by team_builder::place_units(), and game_events::WML_HANDLER_FUNCTION().
unit_creator & unit_creator::allow_add_to_recall | ( | bool | b | ) |
Definition at line 98 of file unit_creator.cpp.
References add_to_recall_.
Referenced by team_builder::place_units(), and game_events::WML_HANDLER_FUNCTION().
unit_creator & unit_creator::allow_discover | ( | bool | b | ) |
Definition at line 91 of file unit_creator.cpp.
References discover_.
Referenced by team_builder::place_units(), and game_events::WML_HANDLER_FUNCTION().
unit_creator & unit_creator::allow_get_village | ( | bool | b | ) |
Definition at line 71 of file unit_creator.cpp.
References get_village_.
Referenced by team_builder::place_units(), and game_events::WML_HANDLER_FUNCTION().
unit_creator & unit_creator::allow_invalidate | ( | bool | b | ) |
Definition at line 84 of file unit_creator.cpp.
References invalidate_.
Referenced by team_builder::place_units(), and game_events::WML_HANDLER_FUNCTION().
unit_creator & unit_creator::allow_rename_side | ( | bool | b | ) |
Definition at line 78 of file unit_creator.cpp.
References rename_side_.
Referenced by team_builder::place_units(), and game_events::WML_HANDLER_FUNCTION().
unit_creator & unit_creator::allow_show | ( | bool | b | ) |
Definition at line 64 of file unit_creator.cpp.
References show_.
Referenced by team_builder::place_units(), and game_events::WML_HANDLER_FUNCTION().
map_location unit_creator::find_location | ( | const config & | cfg, |
const unit * | pass_check = nullptr |
||
) |
finds a suitable location for unit
map_location::null_location() | if unit is to be put into recall list |
valid | on-board map location otherwise |
Definition at line 105 of file unit_creator.cpp.
References board_, DBG_NG, unit_map::find_leader(), pathfind::find_vacant_tile(), resources::gamedata, game_board::map(), map_location::null_location(), gamemap::on_board(), team::side(), gamemap::special_location(), utils::split(), start_pos_, team_, game_board::units(), pathfind::VACANT_ANY, map_location::valid(), and unit_map::iterator_base< iter_types >::valid().
Referenced by add_unit().
|
private |
Definition at line 203 of file unit_creator.cpp.
References board_, discover_, display::draw(), preferences::encountered_units(), game_events::t_pump::fire(), resources::game_events, resources::gameboard, actions::get_village(), get_village_, display::invalidate(), invalidate_, gamemap::is_village(), resources::lua_kernel, game_board::map(), game_events::manager::pump(), resources::screen, gui2::tip::show(), show_, unit::side(), unit::type_id(), and unit_display::unit_recruited().
Referenced by add_unit().
|
private |
Definition at line 58 of file unit_creator.hpp.
Referenced by add_unit(), and allow_add_to_recall().
|
private |
Definition at line 66 of file unit_creator.hpp.
Referenced by add_unit(), find_location(), and post_create().
|
private |
Definition at line 59 of file unit_creator.hpp.
Referenced by allow_discover(), and post_create().
|
private |
Definition at line 60 of file unit_creator.hpp.
Referenced by allow_get_village(), and post_create().
|
private |
Definition at line 61 of file unit_creator.hpp.
Referenced by allow_invalidate(), and post_create().
|
private |
Definition at line 62 of file unit_creator.hpp.
Referenced by allow_rename_side().
|
private |
Definition at line 63 of file unit_creator.hpp.
Referenced by allow_show(), and post_create().
|
private |
Definition at line 64 of file unit_creator.hpp.
Referenced by find_location().
|
private |
Definition at line 65 of file unit_creator.hpp.
Referenced by add_unit(), and find_location().