#include <filter.hpp>
Public Member Functions | |
unit_filter (vconfig cfg) | |
unit_filter (const unit_filter &)=default | |
unit_filter & | operator= (const unit_filter &)=default |
unit_filter (unit_filter &&)=default | |
unit_filter & | operator= (unit_filter &&)=default |
unit_filter & | set_use_flat_tod (bool value) |
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 map_location *loc=nullptr, const unit *other_unit=nullptr) const |
std::vector< const unit * > | all_matches_at (const map_location &loc) const |
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_const_ptr | first_match_on_map () const |
config | to_config () const |
bool | empty () const |
Private Attributes | |
vconfig | cfg_ |
const filter_context * | fc_ |
bool | use_flat_tod_ |
unit_filter_impl::unit_filter_compound | impl_ |
int | max_matches_ |
Definition at line 106 of file filter.hpp.
|
explicit |
Definition at line 51 of file filter.cpp.
|
default |
|
default |
|
inline |
Definition at line 162 of file filter.hpp.
Referenced by game_lua_kernel::intf_get_units().
std::vector< const unit * > unit_filter::all_matches_on_map | ( | const map_location * | loc = nullptr , |
const unit * | other_unit = nullptr |
||
) | const |
Definition at line 68 of file filter.cpp.
References fc_, filter_context::get_disp_context(), impl_, unit_filter_impl::unit_filter_compound::matches(), max_matches_, and display_context::units().
Referenced by game_lua_kernel::intf_find_cost_map(), and game_lua_kernel::intf_get_units().
Definition at line 166 of file filter.hpp.
Referenced by game_lua_kernel::intf_get_units().
|
inline |
Definition at line 170 of file filter.hpp.
|
inline |
Definition at line 180 of file filter.hpp.
Referenced by game_events::entity_location::matches_unit_filter().
unit_const_ptr unit_filter::first_match_on_map | ( | ) | const |
Definition at line 85 of file filter.cpp.
References unit_map::begin(), config_attribute_value::blank(), c, cfg_, unit_filter_impl::unit_filter_args::context(), game_events::builtin_conditions::default_counts, map_location::default_dirs(), config_attribute_value::empty(), unit_map::end(), f, unit_filter_impl::unit_filter_args::fc, fc_, unit_map::find(), resources::gamedata, get_adjacent_tiles(), filter_context::get_disp_context(), display_context::get_team(), in_ranges(), utils::interpolate_variables_into_string(), unit_filter_impl::unit_filter_args::loc, display_context::map(), matches(), map_location::matches_range(), gamemap_base::on_board(), operator()(), map_location::parse_directions(), utils::parse_ranges(), s, unit::side(), unit_filter_impl::unit_filter_args::u, display_context::units(), and unit_filter_impl::unit_filter_args::use_flat_tod.
|
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 127 of file filter.hpp.
References impl_.
Referenced by unit::ability_active(), unit::ability_affects_self(), first_match_on_map(), unit::get_modification_advances(), game_events::entity_location::matches_unit_filter(), and game_events::WML_HANDLER_FUNCTION().
bool unit_filter::matches | ( | const unit & | u | ) | const |
Determine if *this matches filter at its current location.
(Only use for units currently on the map; otherwise use the overload that takes a location, possibly with a null location.)
Definition at line 60 of file filter.cpp.
References fc_, unit::get_location(), impl_, unit_filter_impl::unit_filter_compound::matches(), and use_flat_tod_.
|
inline |
Definition at line 138 of file filter.hpp.
References impl_.
Definition at line 64 of file filter.cpp.
References fc_, unit::get_location(), impl_, unit_filter_impl::unit_filter_compound::matches(), and use_flat_tod_.
|
inline |
Definition at line 144 of file filter.hpp.
Referenced by first_match_on_map().
|
inline |
Definition at line 148 of file filter.hpp.
|
inline |
Definition at line 152 of file filter.hpp.
Definition at line 156 of file filter.hpp.
|
default |
|
default |
|
inline |
Definition at line 117 of file filter.hpp.
Referenced by unit::ability_active(), and unit::ability_affects_self().
|
inline |
Definition at line 176 of file filter.hpp.
|
private |
Definition at line 186 of file filter.hpp.
Referenced by first_match_on_map().
|
private |
Definition at line 187 of file filter.hpp.
Referenced by all_matches_on_map(), first_match_on_map(), and matches().
|
private |
Definition at line 189 of file filter.hpp.
Referenced by all_matches_on_map(), and matches().
|
private |
Definition at line 190 of file filter.hpp.
Referenced by all_matches_on_map().
|
private |
Definition at line 188 of file filter.hpp.
Referenced by matches().