| 53 | } |
| 54 | |
| 55 | std::optional<size_t> ManagedAsset::getConsumerIndex(const Ref<AssetConsumer>& consumer) const { |
| 56 | for (size_t i = 0; i < _consumers.size(); i++) { |
| 57 | if (_consumers[i] == consumer) { |
| 58 | return {i}; |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | return std::nullopt; |
| 63 | } |
| 64 | |
| 65 | const Ref<AssetConsumer>& ManagedAsset::getConsumer(size_t index) const { |
| 66 | return _consumers[index]; |