#include <terrain_filter.hpp>
Public Member Functions | |
terrain_filter (const vconfig &cfg, const gamemap &map, const gamestatus &game_status, const unit_map &units, const bool flat_tod=false, const size_t max_loop=MAX_MAP_AREA) | |
terrain_filter (const vconfig &cfg, const terrain_filter &original) | |
~terrain_filter () | |
terrain_filter (const terrain_filter &other) | |
terrain_filter & | operator= (const terrain_filter &other) |
bool | match (const gamemap::location &loc) |
virtual bool | operator() (const gamemap::location &loc) |
void | get_locations (std::set< gamemap::location > &locs) |
void | restrict (const size_t max_loop) |
void | flatten (const bool flat_tod=true) |
Private Member Functions | |
bool | match_internal (const gamemap::location &loc, const bool ignore_xy) |
Private Attributes | |
const vconfig & | cfg_ |
const gamemap & | map_ |
const gamestatus & | status_ |
const unit_map & | units_ |
terrain_filter_cache | cache_ |
size_t | max_loop_ |
bool | flat_ |
Classes | |
struct | terrain_filter_cache |
Definition at line 28 of file terrain_filter.hpp.
terrain_filter::terrain_filter | ( | const vconfig & | cfg, | |
const gamemap & | map, | |||
const gamestatus & | game_status, | |||
const unit_map & | units, | |||
const bool | flat_tod = false , |
|||
const size_t | max_loop = MAX_MAP_AREA | |||
) |
Definition at line 36 of file terrain_filter.cpp.
References flatten(), and restrict().
Referenced by get_locations(), match(), match_internal(), and operator=().
terrain_filter::terrain_filter | ( | const vconfig & | cfg, | |
const terrain_filter & | original | |||
) |
Definition at line 44 of file terrain_filter.cpp.
References flat_, flatten(), max_loop_, and restrict().
terrain_filter::~terrain_filter | ( | ) | [inline] |
terrain_filter::terrain_filter | ( | const terrain_filter & | other | ) |
Definition at line 51 of file terrain_filter.cpp.
References flat_, flatten(), max_loop_, and restrict().
terrain_filter & terrain_filter::operator= | ( | const terrain_filter & | other | ) |
Definition at line 63 of file terrain_filter.cpp.
References terrain_filter(), and ~terrain_filter().
bool terrain_filter::match | ( | const gamemap::location & | loc | ) |
Definition at line 253 of file terrain_filter.cpp.
References cfg_, cond, ERR_NG, vconfig::all_children_iterator::get_child(), vconfig::all_children_iterator::get_key(), get_tiles_radius(), map_, match_internal(), max_loop_, gamemap::on_board(), radius, and terrain_filter().
Referenced by unit::ability_active(), unit::internal_matches_filter(), operator()(), and attack_type::special_active().
virtual bool terrain_filter::operator() | ( | const gamemap::location & | loc | ) | [inline, virtual] |
void terrain_filter::get_locations | ( | std::set< gamemap::location > & | locs | ) |
Definition at line 320 of file terrain_filter.cpp.
References terrain_filter::terrain_filter_cache::adjacent_matches, variable_info::as_array(), variable_info::as_container(), cache_, cfg_, cond, ERR_NG, variable_info::explicit_index, vconfig::all_children_iterator::get_child(), vconfig::get_children(), vconfig::all_children_iterator::get_key(), get_tiles_radius(), gamemap::h(), vconfig::has_attribute(), vconfig::has_child(), variable_info::is_valid, map_, match_internal(), max_loop_, vconfig::ordered_begin(), vconfig::ordered_end(), parse_location_range(), radius, terrain_filter(), variable_info::TYPE_CONTAINER, and gamemap::w().
void terrain_filter::restrict | ( | const size_t | max_loop | ) | [inline] |
Definition at line 49 of file terrain_filter.hpp.
References max_loop_.
Referenced by terrain_filter().
void terrain_filter::flatten | ( | const bool | flat_tod = true |
) | [inline] |
Definition at line 52 of file terrain_filter.hpp.
References flat_.
Referenced by unit::ability_active(), and terrain_filter().
bool terrain_filter::match_internal | ( | const gamemap::location & | loc, | |
const bool | ignore_xy | |||
) | [private] |
Definition at line 81 of file terrain_filter.cpp.
References terrain_filter::terrain_filter_cache::adjacent_match_cache, terrain_filter::terrain_filter_cache::adjacent_matches, variable_info::as_array(), variable_info::as_container(), cache_, cfg_, vconfig::child(), dummy_cfg, unit_map::end(), variable_info::explicit_index, unit_map::find(), flat_, get_adjacent_tiles(), vconfig::get_children(), gamemap::get_terrain_info(), gamestatus::get_time_of_day(), vconfig::has_attribute(), vconfig::has_child(), time_of_day::id, t_translation::t_match::is_empty, variable_info::is_valid, time_of_day::lawful_bonus, map_, gamemap::location::matches_range(), terrain_type::number(), gamemap::on_board(), gamemap::location::parse_directions(), utils::parse_ranges(), terrain_filter::terrain_filter_cache::parsed_terrain, utils::split(), status_, gamestatus::teams, terrain_filter(), t_translation::terrain_matches(), timeofday_at(), variable_info::TYPE_CONTAINER, units_, and village_owner().
Referenced by get_locations(), and match().
const vconfig& terrain_filter::cfg_ [private] |
Definition at line 57 of file terrain_filter.hpp.
Referenced by get_locations(), match(), and match_internal().
const gamemap& terrain_filter::map_ [private] |
Definition at line 58 of file terrain_filter.hpp.
Referenced by get_locations(), match(), and match_internal().
const gamestatus& terrain_filter::status_ [private] |
const unit_map& terrain_filter::units_ [private] |
terrain_filter_cache terrain_filter::cache_ [private] |
Definition at line 79 of file terrain_filter.hpp.
Referenced by get_locations(), and match_internal().
size_t terrain_filter::max_loop_ [private] |
Definition at line 80 of file terrain_filter.hpp.
Referenced by get_locations(), match(), restrict(), and terrain_filter().
bool terrain_filter::flat_ [private] |
Definition at line 81 of file terrain_filter.hpp.
Referenced by flatten(), match_internal(), and terrain_filter().
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |