| 308 | } |
| 309 | |
| 310 | int GameFeatures::unregisterGameFeatures(MOBase::IPlugin* plugin, |
| 311 | std::type_info const& info) |
| 312 | { |
| 313 | auto& features = m_allFeatures[info]; |
| 314 | |
| 315 | const auto initialSize = features.size(); |
| 316 | |
| 317 | features.erase(std::remove_if(features.begin(), features.end(), |
| 318 | [plugin](const auto& feature) { |
| 319 | return feature.plugin() == plugin; |
| 320 | }), |
| 321 | features.end()); |
| 322 | |
| 323 | const int removed = features.size() - initialSize; |
| 324 | |
| 325 | if (removed) { |
| 326 | updateCurrentFeatures(); |
| 327 | } |
| 328 | |
| 329 | return removed; |
| 330 | } |
| 331 | |
| 332 | std::shared_ptr<GameFeature> GameFeatures::gameFeature(std::type_info const& info) const |
| 333 | { |
no test coverage detected