#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, bool fire_event) |
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 32 of file unit_creator.hpp.
unit_creator::unit_creator | ( | team & | tm, |
const map_location & | start_pos, | ||
game_board * | board = nullptr |
||
) |
Definition at line 47 of file unit_creator.cpp.
adds a unit on map without firing any events (so, usable during team construction in gamestatus)
Definition at line 170 of file unit_creator.cpp.
References recall_list_manager::add(), add_to_recall_, board_, unit::create(), DBG_NG, prefs::encountered_units(), recall_list_manager::erase_if_matches_id(), unit_map::find(), recall_list_manager::find_if_matches_id(), find_location(), gui2::event::implementation::fire_event(), prefs::get(), config::get(), id, LOG_NG, post_create(), team::recall_list(), config::remove_attribute(), unit_map::replace(), team::side(), team_, 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 95 of file unit_creator.cpp.
References add_to_recall_, and b.
Referenced by team_builder::place_units(), and game_events::WML_HANDLER_FUNCTION().
unit_creator & unit_creator::allow_discover | ( | bool | b | ) |
Definition at line 88 of file unit_creator.cpp.
Referenced by team_builder::place_units(), and game_events::WML_HANDLER_FUNCTION().
unit_creator & unit_creator::allow_get_village | ( | bool | b | ) |
Definition at line 68 of file unit_creator.cpp.
References b, and 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 81 of file unit_creator.cpp.
References b, and 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 75 of file unit_creator.cpp.
References b, and 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 61 of file unit_creator.cpp.
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 102 of file unit_creator.cpp.
References board_, DBG_NG, deprecated_message(), unit_map::find_leader(), pathfind::find_vacant_tile(), resources::gamedata, config::has_attribute(), game_board::map(), map_location::null_location(), gamemap_base::on_board(), PREEMPTIVE, team::side(), gamemap_base::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 216 of file unit_creator.cpp.
References board_, discover_, prefs::encountered_units(), game_events::wml_event_pump::fire(), gui2::event::implementation::fire_event(), display::fogged(), resources::game_events, resources::gameboard, prefs::get(), display::get_singleton(), actions::get_village(), get_village_, display::invalidate(), invalidate_, gamemap::is_village(), resources::lua_kernel, game_board::map(), game_events::manager::pump(), gui2::dialogs::tip::show(), show_, unit::side(), unit::type_id(), and unit_display::unit_recruited().
Referenced by add_unit().
|
private |
Definition at line 59 of file unit_creator.hpp.
Referenced by add_unit(), and allow_add_to_recall().
|
private |
Definition at line 67 of file unit_creator.hpp.
Referenced by add_unit(), find_location(), and post_create().
|
private |
Definition at line 60 of file unit_creator.hpp.
Referenced by allow_discover(), and post_create().
|
private |
Definition at line 61 of file unit_creator.hpp.
Referenced by allow_get_village(), and post_create().
|
private |
Definition at line 62 of file unit_creator.hpp.
Referenced by allow_invalidate(), and post_create().
|
private |
Definition at line 63 of file unit_creator.hpp.
Referenced by allow_rename_side().
|
private |
Definition at line 64 of file unit_creator.hpp.
Referenced by allow_show(), and post_create().
|
private |
Definition at line 65 of file unit_creator.hpp.
Referenced by find_location().
|
private |
Definition at line 66 of file unit_creator.hpp.
Referenced by add_unit(), and find_location().