29 #define ERR_NG LOG_STREAM(err, log_engine)
30 #define LOG_NG LOG_STREAM(info, log_engine)
38 , u_type(recruited->
type())
49 throw config::error(
"Invalid recruit; unit type '" + child[
"type"].str() +
"' was not found.\n");
57 , recruit_from(
map_location(cfg.child_or_empty(
"leader"), nullptr))
86 if ( un_it == units.
end() ) {
90 const unit &un = *un_it;
99 gui.invalidate(recruit_loc);
100 units.
erase(recruit_loc);
A config object defines a single node in a WML file, with access to child nodes.
config & mandatory_child(config_key_type key, int n=0)
Returns the nth child with the given key, or throws an error if there is none.
config & add_child(config_key_type key)
virtual const unit_map & units() const override
static game_display * get_singleton()
statistics_t & statistics()
void un_recruit_unit(const unit &u)
This class stores all the data for a single 'side' (in game nomenclature).
void set_action_bonus_count(const int count)
int action_bonus_count() const
void spend_gold(const int amount)
Container associating units to locations.
unit_iterator find(std::size_t id)
std::size_t erase(const map_location &l)
Erases the unit at location l, if any.
const unit_type * find(const std::string &key, unit_type::BUILD_STATUS status=unit_type::FULL) const
Finds a unit_type by its id() and makes sure it is built to the specified level.
A single unit type that the player may recruit.
const std::string & parent_id() const
The id of the original type from which this (variation) descended.
This class represents a single unit of a specific type.
const unit_type & type() const
This unit's type, accounting for gender and variation.
Standard logging facilities (interface).
static const unit_type & get_unit_type(const config &cfg)
static auto reg_undo_recruit
play_controller * controller
std::shared_ptr< const unit > unit_const_ptr
base class for classes that clear srhoud (move/recruit/recall)
route_t route
The hexes occupied by the affected unit during this action.
void write(config &cfg) const
recruit_action(const unit_const_ptr &recruited, const map_location &loc, const map_location &from)
map_location recruit_from
virtual void write(config &cfg) const
Writes this into the provided config.
virtual bool undo(int side)
Undoes this action.
Records information to be able to undo an action.
virtual void write(config &cfg) const
Writes this into the provided config.
Encapsulates the map of the game.
void write(config &cfg) const
unit_type_data unit_types
static lg::log_domain log_engine("engine")