commonMain.eu.codlab.lorcana.cards.Erratas.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lorcana-data Show documentation
Show all versions of lorcana-data Show documentation
Lorcana set descriptions and data
package eu.codlab.lorcana.cards
import kotlinx.serialization.Serializable
@Serializable
data class Erratas(
val classifications: List? = null
)
@Suppress("TooGenericExceptionCaught")
fun Erratas.to(
mapOfClassifications: Map
): Erratas = Erratas(
classifications = classifications?.map { slug ->
try {
mapOfClassifications[slug]!!
} catch (err: Throwable) {
println("Exception thrown because $slug couldn't be mapped")
throw err
}
}
)