mirror of
https://github.com/zoriya/Bomberman.git
synced 2025-12-21 13:55:10 +00:00
Reworking dependencies
This commit is contained in:
@@ -59,4 +59,12 @@ namespace WAL
|
||||
});
|
||||
return existing != this->_components.end();
|
||||
}
|
||||
|
||||
bool Entity::hasComponent(const std::type_index &type) const
|
||||
{
|
||||
auto existing = std::find_if(this->_components.begin(), this->_components.end(), [&type] (const auto &cmp) {
|
||||
return std::type_index(typeid(*cmp)) == type;
|
||||
});
|
||||
return existing != this->_components.end();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user