32 [&unit_id](
const unit_ptr & ptr) { return ptr->id() == unit_id; });
46 [&unit_id](
const unit_ptr & ptr) { return ptr->id() == unit_id; });
66 if (pos < 0 || pos >=
static_cast<int>(
recall_list_.size())) {
77 [&unit_id](
const unit_ptr & ptr) { return ptr->id() == unit_id; });
85 [&unit_id](
const unit_ptr & ptr) { return ptr->id() == unit_id; });
101 [uid](
const unit_ptr & ptr) { return ptr->underlying_id() == uid; });
112 [uid](
const unit_ptr & ptr) { return ptr->underlying_id() == uid; });
128 [uid](
const unit_ptr & ptr) { return ptr->underlying_id() == uid; });
unit_ptr extract_if_matches_id(const std::string &unit_id, int *pos=nullptr)
Find a unit by id, and extract from this object if found.
iterator erase(iterator it)
Erase an iterator to this object.
unit_ptr find_if_matches_underlying_id(std::size_t uid)
Find a unit by underlying id.
void add(const unit_ptr &ptr, int pos=-1)
Add a unit to the list.
std::vector< unit_ptr > recall_list_
The underlying data struture.
unit_ptr find_if_matches_id(const std::string &unit_id)
Find a unit by id.
iterator erase_index(std::size_t index)
Erase by index.
std::size_t find_index(const std::string &unit_id) const
Find the index of a unit by its id.
void erase_by_underlying_id(std::size_t uid)
Erase any unit with this underlying id.
void erase_if_matches_id(const std::string &unit_id)
Erase any unit with this id.
unit_ptr extract_if_matches_underlying_id(std::size_t uid)
Find a unit by underlying id, and extract if found.
void erase_if(Container &container, const Predicate &predicate)
Convenience wrapper for using std::remove_if on a container.
std::string::const_iterator iterator
std::shared_ptr< const unit > unit_const_ptr
std::shared_ptr< unit > unit_ptr