#include <filter.hpp>
Public Member Functions | |
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 implementation available. More... | |
unit_filter (const unit_filter &o) | |
void | swap (unit_filter &o) |
unit_filter & | operator= (unit_filter o) |
bool | matches (const unit &u, const map_location &loc) const |
Determine if *this matches filter at a specified location. More... | |
bool | matches (const unit &u) const |
Determine if *this matches filter at its current location. More... | |
bool | matches (const unit &u, const map_location &loc, const unit &u2) const |
bool | matches (const unit &u, const unit &u2) const |
bool | operator() (const unit &u, const map_location &loc) const |
bool | operator() (const unit &u) const |
bool | operator() (const unit &u, const map_location &loc, const unit &u2) const |
bool | operator() (const unit &u, const unit &u2) const |
std::vector< const unit * > | all_matches_on_map () const |
unit_const_ptr | first_match_on_map () const |
config | to_config () const |
bool | empty () const |
Private Attributes | |
boost::shared_ptr < unit_filter_abstract_impl > | impl_ |
unsigned | max_matches_ |
Definition at line 50 of file filter.hpp.
unit_filter::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 implementation available.
Ctor of unit filter unit_filter::unit_filter acts as a factory, selecting the appropriate implementation class.
Definition at line 210 of file filter.cpp.
References construct(), impl_, and max_matches_.
|
inline |
Definition at line 55 of file filter.hpp.
|
inline |
Definition at line 94 of file filter.hpp.
References impl_, and max_matches_.
|
inline |
Definition at line 104 of file filter.hpp.
References impl_.
|
inline |
Definition at line 98 of file filter.hpp.
References impl_.
Referenced by unit_display::wml_animation_internal().
|
inline |
Determine if *this matches filter at a specified location.
Use this for units on a recall list, or to test for a match if a unit is hypothetically moved.
Definition at line 67 of file filter.hpp.
References impl_.
Referenced by unit::ability_active(), unit::ability_affects_self(), unit::add_modification(), matches(), game_events::entity_location::matches_unit_filter(), operator()(), attack_type::special_active(), and game_events::WML_HANDLER_FUNCTION().
bool unit_filter::matches | ( | const unit & | u | ) | const |
Determine if *this matches filter at its current location.
Defined out of line to prevent including unit at unit_filter.hpp.
(Only use for units currently on the map; otherwise use the overload that takes a location, possibly with a null location.)
Definition at line 57 of file filter.cpp.
References unit::get_location(), and matches().
bool unit_filter::matches | ( | const unit & | u, |
const map_location & | loc, | ||
const unit & | u2 | ||
) | const |
Definition at line 61 of file filter.cpp.
References impl_.
Definition at line 65 of file filter.cpp.
References unit::get_location(), and matches().
|
inline |
Definition at line 78 of file filter.hpp.
References matches().
|
inline |
Definition at line 82 of file filter.hpp.
References matches().
|
inline |
Definition at line 86 of file filter.hpp.
References matches().
Definition at line 90 of file filter.hpp.
References matches().
|
inline |
Definition at line 59 of file filter.hpp.
References swap().
|
inline |
config unit_filter::to_config | ( | ) | const |
Definition at line 52 of file filter.cpp.
References impl_.
|
private |
Definition at line 108 of file filter.hpp.
Referenced by all_matches_on_map(), empty(), first_match_on_map(), matches(), swap(), to_config(), and unit_filter().
|
private |
Definition at line 109 of file filter.hpp.
Referenced by all_matches_on_map(), and unit_filter().