30 template<
typename FPred1,
typename FPred2>
31 void get_tiles_radius(std::set<map_location>&& locs,
size_t radius, std::set<map_location>& result,
const FPred1& pred1,
const FPred2& pred2)
37 for ( ; radius != 0 && !not_visited.empty(); --radius )
39 location_set::const_iterator it = not_visited.begin();
40 location_set::const_iterator it_end = not_visited.end();
42 result.insert(it, it_end);
43 for(; it != it_end; ++it) {
46 if( !result.count(loc) && !filtered_out.count(loc) ) {
48 must_visit.insert(loc);
51 filtered_out.insert(loc);
58 not_visited.swap(must_visit);
62 result.insert(not_visited.begin(), not_visited.end());
void get_adjacent_tiles(const map_location &a, map_location *res)
Function which, given a location, will place all adjacent locations in res.
std::set< map_location > location_set
void get_tiles_radius(std::set< map_location > &&locs, size_t radius, std::set< map_location > &result, const FPred1 &pred1, const FPred2 &pred2)
Function that will add to result all elements of locs, plus all on-board (that is: all locs that matc...
Encapsulates the map of the game.