#include <filter.hpp>
Public Member Functions | |
unit_filter (const 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 102 of file filter.hpp.
|
explicit |
Definition at line 50 of file filter.cpp.
|
default |
|
default |
|
inline |
Definition at line 158 of file filter.hpp.
References all_matches_on_map(), and loc.
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 67 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 all_matches_at(), all_matches_with_unit(), all_matches_with_unit_at(), and game_lua_kernel::intf_get_units().
Definition at line 162 of file filter.hpp.
References all_matches_on_map().
Referenced by game_lua_kernel::intf_get_units().
|
inline |
Definition at line 166 of file filter.hpp.
References all_matches_on_map(), and loc.
|
inline |
Definition at line 176 of file filter.hpp.
References cfg_, config::empty(), and vconfig::get_config().
Referenced by game_events::entity_location::matches_unit_filter().
unit_const_ptr unit_filter::first_match_on_map | ( | ) | const |
Definition at line 84 of file filter.cpp.
References unit_map::begin(), unit_map::end(), fc_, filter_context::get_disp_context(), matches(), and display_context::units().
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 59 of file filter.cpp.
References fc_, unit::get_location(), impl_, unit_filter_impl::unit_filter_compound::matches(), and 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 123 of file filter.hpp.
References fc_, impl_, loc, unit_filter_impl::unit_filter_compound::matches(), and use_flat_tod_.
Referenced by unit::ability_affects_self(), first_match_on_map(), pathfind::teleport_group::get_teleport_pair(), game_events::entity_location::matches_unit_filter(), operator()(), and game_events::WML_HANDLER_FUNCTION().
|
inline |
Definition at line 134 of file filter.hpp.
References fc_, impl_, loc, unit_filter_impl::unit_filter_compound::matches(), and use_flat_tod_.
Definition at line 63 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.
References matches().
|
inline |
Definition at line 140 of file filter.hpp.
|
inline |
Definition at line 148 of file filter.hpp.
Definition at line 152 of file filter.hpp.
References matches().
|
default |
|
default |
|
inline |
Definition at line 113 of file filter.hpp.
References use_flat_tod_.
Referenced by unit::ability_affects_self().
|
inline |
Definition at line 172 of file filter.hpp.
References cfg_, and vconfig::get_config().
Referenced by game_events::filter_unit::serialize().
|
private |
Definition at line 182 of file filter.hpp.
Referenced by empty(), and to_config().
|
private |
Definition at line 183 of file filter.hpp.
Referenced by all_matches_on_map(), first_match_on_map(), and matches().
|
private |
Definition at line 185 of file filter.hpp.
Referenced by all_matches_on_map(), and matches().
|
private |
Definition at line 186 of file filter.hpp.
Referenced by all_matches_on_map().
|
private |
Definition at line 184 of file filter.hpp.
Referenced by matches(), and set_use_flat_tod().