Add ability to remove a feature by key

This commit is contained in:
Alexander Nozik 2023-02-13 17:32:48 +03:00
parent dab9784089
commit 7623e5f622
2 changed files with 5 additions and 1 deletions

View File

@ -10,7 +10,7 @@ val kmathVersion: String by extra("0.3.1-dev-10")
allprojects {
group = "center.sciprog"
version = "0.2.2-dev-5"
version = "0.2.2-dev-6"
repositories {
mavenLocal()

View File

@ -51,6 +51,10 @@ public data class FeatureGroup<T : Any>(
return FeatureRef(safeId, this)
}
public fun removeFeature(id: String) {
featureMap.remove(id)
}
// public fun <F : Feature<T>> feature(id: FeatureId<F>, feature: F): FeatureId<F> = feature(id.id, feature)
public val features: Collection<Feature<T>> get() = featureMap.values.sortedByDescending { it.z }