io.elderscrollslegends.Collection.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elderscrolls-legends-sdk-java Show documentation
Show all versions of elderscrolls-legends-sdk-java Show documentation
A java wrapper around the Elder Scrolls: Legends API of https://elderscrollslegends.io
package io.elderscrollslegends
class Collection(
cards: List = emptyList()
): CardGrouping(cards) {
fun exportCode(idMapper: (cardId: String) -> String = { Decoder.idToCodeMap.getOrDefault(it, "__") }): String {
return Decoder(DecoderType.COLLECTION, idMapper).createExportCode(this)
}
companion object {
@JvmStatic
fun importCode(code: String) = Collection(Decoder(DecoderType.COLLECTION).createListFromCode(code))
}
}