26 #ifndef INCLUDED_UNIT_FILTER_HPP_
27 #define INCLUDED_UNIT_FILTER_HPP_
31 #include <boost/shared_ptr.hpp>
46 virtual bool empty()
const {
return false;}
68 return impl_->matches(u,loc);
99 return impl_->first_match_on_map();
105 return impl_->empty();
virtual std::vector< const unit * > all_matches_on_map(unsigned max_matches) const =0
virtual ~unit_filter_abstract_impl()
std::vector< const unit * > all_matches_on_map() const
boost::shared_ptr< unit_filter_abstract_impl > impl_
void swap(unit_filter &o)
bool operator()(const unit &u, const map_location &loc, const unit &u2) const
bool operator()(const unit &u) const
unit_const_ptr first_match_on_map() const
bool matches(const unit &u, const map_location &loc) const
Determine if *this matches filter at a specified location.
virtual bool matches(const unit &u, const map_location &loc, const unit *u2=nullptr) const =0
virtual unit_const_ptr first_match_on_map() const =0
unit_filter & operator=(unit_filter o)
Encapsulates the map of the game.
virtual bool empty() const
unit_filter(const vconfig &cfg, const filter_context *fc, bool use_flat_tod=false)
Constructs a unit filter from a config and a context. This function should give the most efficient im...
bool operator()(const unit &u, const unit &u2) const
A variable-expanding proxy for the config class.
virtual config to_config() const =0
unit_filter(const unit_filter &o)
GLuint GLdouble GLdouble u2
A config object defines a single node in a WML file, with access to child nodes.
bool operator()(const unit &u, const map_location &loc) const