Unit Map: added has_unit_at helper function
Just a small wrapper function to check whether a unit is present a certain location.
This commit is contained in:
parent
fc8e9cf07e
commit
1408da68ce
2 changed files with 8 additions and 0 deletions
|
@ -385,3 +385,8 @@ bool unit_map::has_unit(const unit * const u) const
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool unit_map::has_unit_at(const map_location& loc) const
|
||||
{
|
||||
return find(loc) != end();
|
||||
}
|
||||
|
|
|
@ -394,6 +394,9 @@ public:
|
|||
*/
|
||||
bool has_unit(const unit * const u) const ;
|
||||
|
||||
/** Tests whether a unit exists at the given location. */
|
||||
bool has_unit_at(const map_location& loc) const;
|
||||
|
||||
private:
|
||||
umap::iterator begin_core() const ;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue