76 : u(u), loc(loc), u2(u2), fc(fc), use_flat_tod(use_flat_tod)
90 template<
typename C,
typename F>
93 void create_child(
const vconfig& c, F func);
100 std::vector<std::shared_ptr<unit_filter_base>>
children_;
101 std::vector<std::pair<conditional_type::type, unit_filter_compound>>
cond_children_;
118 use_flat_tod_ = value;
136 bool matches(
const unit & u)
const;
142 bool matches(
const unit & u,
const unit & u2)
const;
145 return matches(u, loc);
153 return matches(u, loc, u2);
157 return matches(u, u2);
160 std::vector<const unit *> all_matches_on_map(
const map_location* loc =
nullptr,
const unit* other_unit =
nullptr)
const;
163 return all_matches_on_map(&loc);
167 return all_matches_on_map(
nullptr, &u);
171 return all_matches_on_map(&loc, &u);
177 return cfg_.get_config();
181 return cfg_.get_config().empty();
filter_error(const std::string &message="filter error")
const filter_context * fc_
This class represents a single unit of a specific type.
unit_filter & set_use_flat_tod(bool value)
Variant for storing WML attributes.
bool operator()(const unit &u, const map_location &loc) const
bool matches(const unit &u, const map_location &loc) const
Determine if *this matches filter at a specified location.
const filter_context & context() const
std::shared_ptr< const unit > unit_const_ptr
std::vector< const unit * > all_matches_with_unit(const unit &u) const
std::vector< const unit * > all_matches_with_unit_at(const unit &u, const map_location &loc) const
unit_filter_impl::unit_filter_compound impl_
std::vector< std::pair< conditional_type::type, unit_filter_compound > > cond_children_
bool operator()(const unit &u) const
bool operator()(const unit &u, const map_location &loc, const unit &u2) const
const filter_context * fc
Encapsulates the map of the game.
std::vector< std::shared_ptr< unit_filter_base > > children_
virtual ~unit_filter_base()
bool matches(const unit &u, const map_location &loc, const unit &u2) const
Base class for all the errors encountered by the engine.
A variable-expanding proxy for the config class.
bool operator()(const unit &u, const unit &u2) const
A config object defines a single node in a WML file, with access to child nodes.
void fill(const SDL_Rect &rect, uint8_t r, uint8_t g, uint8_t b, uint8_t a)
Fill an area with the given colour.
std::vector< const unit * > all_matches_at(const map_location &loc) const
unit_filter_args(const unit &u, map_location loc, const unit *u2, const filter_context *fc, bool use_flat_tod)