#include <filter.hpp>
Public Member Functions | |
unit_filter_compound (vconfig cfg) | |
template<typename C , typename F > | |
void | create_attribute (const config::attribute_value c, C conv, F func) |
template<typename F > | |
void | create_child (const vconfig &c, F func) |
void | fill (vconfig cfg) |
virtual bool | matches (const unit_filter_args &u) const override |
bool | filter_impl (const unit_filter_args &u) const |
Public Member Functions inherited from unit_filter_impl::unit_filter_base | |
virtual | ~unit_filter_base () |
Public Attributes | |
std::vector< std::shared_ptr< unit_filter_base > > | children_ |
std::vector< std::pair< conditional_type::type, unit_filter_compound > > | cond_children_ |
Definition at line 82 of file filter.hpp.
unit_filter_compound::unit_filter_compound | ( | vconfig | cfg | ) |
Definition at line 225 of file filter.cpp.
References fill().
void unit_filter_compound::create_attribute | ( | const config::attribute_value | c, |
C | conv, | ||
F | func | ||
) |
Definition at line 284 of file filter.cpp.
References config_attribute_value::apply_visitor(), config_attribute_value::blank(), children_, and config_attribute_value::str().
Referenced by fill().
void unit_filter_compound::create_child | ( | const vconfig & | c, |
F | func | ||
) |
Definition at line 278 of file filter.cpp.
void unit_filter_compound::fill | ( | vconfig | cfg | ) |
Definition at line 316 of file filter.cpp.
References unit::abilities(), c, unit_filter_impl::unit_filter_args::context(), create_attribute(), config::empty(), unit_ability_list::empty(), unit_map::end(), unit_type_data::find(), unit_map::find(), unit::gender(), unit::get_abilities(), unit::get_adj_ability_bool(), get_adjacent_tiles(), vconfig::get_config(), filter_context::get_disp_context(), unit::get_self_ability_bool(), unit::get_traits_list(), unit::has_ability_by_id(), unit::has_ability_type(), i, unit_race::id(), unit::id(), unit_filter_impl::unit_filter_args::loc, unit::name(), unit_type::parent_id(), unit::race(), s, utils::split(), string_gender(), unit::type(), unit::type_id(), unit_filter_impl::unit_filter_args::u, unit_types, display_context::units(), unit::upkeep(), and unit::variation().
Referenced by unit_filter_compound().
bool unit_filter_compound::filter_impl | ( | const unit_filter_args & | u | ) | const |
|
overridevirtual |
Implements unit_filter_impl::unit_filter_base.
Definition at line 232 of file filter.cpp.
References cond_children_, unit_filter_impl::unit_filter_args::context(), filter_impl(), filter_context::get_disp_context(), unit::get_location(), unit_filter_impl::unit_filter_args::loc, unit_filter_impl::unit_filter_args::u, unit_filter_impl::unit_filter_args::u2, display_context::units(), and map_location::valid().
Referenced by unit_filter::all_matches_on_map(), and unit_filter::matches().
std::vector<std::shared_ptr<unit_filter_base> > unit_filter_impl::unit_filter_compound::children_ |
Definition at line 96 of file filter.hpp.
Referenced by create_attribute(), create_child(), and filter_impl().
std::vector<std::pair<conditional_type::type, unit_filter_compound> > unit_filter_impl::unit_filter_compound::cond_children_ |
Definition at line 97 of file filter.hpp.
Referenced by matches().