mirror of
https://github.com/MadeOfJelly/MushMachine.git
synced 2024-10-29 22:45:34 +01:00
improve resouce iteration
This commit is contained in:
parent
a98098af91
commit
ab169927fe
@ -85,7 +85,8 @@ class ResourceManager {
|
|||||||
discard(entt::hashed_string{id}.value());
|
discard(entt::hashed_string{id}.value());
|
||||||
}
|
}
|
||||||
|
|
||||||
void each(std::function<void(res_id_type, std::shared_ptr<Resource>)>& fn) {
|
template<typename FN>
|
||||||
|
void each(FN&& fn) {
|
||||||
for (auto& it : _storage) {
|
for (auto& it : _storage) {
|
||||||
fn(it.first, it.second);
|
fn(it.first, it.second);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user