All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.eu.codlab.lorcana.cards.Erratas.kt Maven / Gradle / Ivy

There is a newer version: 0.13.0
Show newest version
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
        }
    }
)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy