58 , id_(u.underlying_id())
69 , id_(u.underlying_id())
70 , filter_loc_(filter_loc)
82 return id_ == 0 || ( un_it.
valid() &&
id_ == un_it->underlying_id() );
virtual const unit_map & units() const override
bool matches(const unit &u, const map_location &loc) const
Determine if *this matches filter at a specified location.
unit_iterator find(std::size_t id)
This class represents a single unit of a specific type.
Define locations as used by the game's events mechanism.
std::string id
Text to match against addon_info.tags()
static std::string get_location(const std::string &loc)
std::shared_ptr< const unit > unit_const_ptr
entity_location(const map_location &loc, std::size_t id=0)
Constructor for when an event has a location but not necessarily a unit.
bool matches_unit(const unit_map::const_iterator &un_it) const
Determines if un_it matches (using underlying ID) the unit that was supplied when this was constructe...
static const entity_location null_entity
std::size_t id_
The underlying ID of the unit associated with this.
bool matches_unit_filter(const unit_map::const_iterator &un_it, const unit_filter &filter) const
Determines if un_it matches filter.
map_location filter_loc_
This map_location allows a unit to be filtered as if it were somewhere other than where it is.
unit_const_ptr get_unit() const
Encapsulates the map of the game.
static const map_location & null_location()
pointer get_shared_ptr() const
This is exactly the same as operator-> but it's slightly more readable, and can replace &*iter syntax...