86 template<
typename C,
typename F>
96 std::vector<std::shared_ptr<unit_filter_base>>
children_;
97 std::vector<std::pair<conditional_type::type, unit_filter_compound>>
cond_children_;
Variant for storing WML attributes.
A config object defines a single node in a WML file, with access to child nodes.
unit_filter(const vconfig &cfg)
const filter_context * fc_
std::vector< const unit * > all_matches_with_unit_at(const unit &u, const map_location &loc) const
unit_filter(const unit_filter &)=default
bool operator()(const unit &u) const
std::vector< const unit * > all_matches_with_unit(const unit &u) const
bool operator()(const unit &u, const map_location &loc, const unit &u2) const
bool matches(const unit &u, const map_location &loc) const
Determine if *this matches filter at a specified location.
unit_filter & operator=(const unit_filter &)=default
std::vector< const unit * > all_matches_at(const map_location &loc) const
std::vector< const unit * > all_matches_on_map(const map_location *loc=nullptr, const unit *other_unit=nullptr) const
bool matches(const unit &u, const map_location &loc, const unit &u2) const
unit_filter & set_use_flat_tod(bool value)
unit_filter & operator=(unit_filter &&)=default
bool operator()(const unit &u, const unit &u2) const
unit_const_ptr first_match_on_map() const
unit_filter_impl::unit_filter_compound impl_
unit_filter(unit_filter &&)=default
bool operator()(const unit &u, const map_location &loc) const
This class represents a single unit of a specific type.
A variable-expanding proxy for the config class.
const config & get_config() const
std::shared_ptr< const unit > unit_const_ptr
Base class for all the errors encountered by the engine.
Encapsulates the map of the game.
filter_error(const std::string &message="filter error")
unit_filter_args(const unit &u, map_location loc, const unit *u2, const filter_context *fc, bool use_flat_tod)
const filter_context & context() const
const filter_context * fc
virtual bool matches(const unit_filter_args &) const =0
virtual ~unit_filter_base()
bool filter_impl(const unit_filter_args &u) const
void fill(const vconfig &cfg)
void create_child(const vconfig &c, F func)
void create_attribute(const config::attribute_value c, C conv, F func)
std::vector< std::pair< conditional_type::type, unit_filter_compound > > cond_children_
unit_filter_compound(const vconfig &cfg)
virtual bool matches(const unit_filter_args &u) const override
std::vector< std::shared_ptr< unit_filter_base > > children_