
Manages and provides access to Lorcana card data, offering raw JSON files and an API for retrieving card lists, variants, abilities, and franchise information.
Holding lorcana data only
Raw JSON
You can access to the raw jsons inside data.
Gradle
A Kotlin Multiplatform library is available using
implementation("eu.codlab:lorcana-data:$version")This will work on the following platforms :
val lorcana = Lorcana().loadFromResources()
# load eiher from the resources or github, in this sample it'll be resources
The API will give you either the flatten list of cards or the condensed version. The difference between boths is that when using the condensed version, you will be able to get the various other versions of the card :
Get the list of flatten cards
val tfc = lorcana.set(SetDescription.TFC).cards
println("This will give you ${tfc.size} = 204+12 cards")
Get the list of virtual cards
val tfc = lorcana.set(SetDescription.TFC).virtualCards
println("This will give you ${tfc.size} = 204 cards")
The following is the definition for the Card, which are variant specific The cards are defined in the data folder
The model is as the following :
interface Card {
cost: int
inkwell: boolean
colors: InkColor[]
type: CardType
classification: ClassificationHolder[]
attack: int?
defence: int?
move_cost: int?
lore: int?
languages: CardTranslations
abilities: Ability[]
set: SetDescription
number: int
illustrator: string
dreamborn: string
ravensburger: string
rarity: VariantRarity
franchise: Franchise
third_party: CardThirdParty
}
The VirtualCard is an object which contains all the card information + every specific variant info in a sub-array which can then be used to make bijection on the cards themselves The model is as the following :
interface VirtualCard {
cost: int
inkwell: boolean
colors: InkColor[]
type: CardType
classification: ClassificationHolder[]
attack: int?
defence: int?
move_cost: int?
lore: int?
languages: CardTranslations
abilities: Ability[]
variants:
- set: SetDescription
number: int
illustrator: string
dreamborn: string
ravensburger: string
rarity: VariantRarity
franchise: Franchise
third_party: CardThirdParty
}interface Ability {
type: AbilityType,
title: TranslationHolder?,
text: TranslationHolder?,
ability: string?
}Those contains information which are country specific :
interface TranslationHolder {
[countryCode: string]: string? // "en" should always be there
}interface CardTranslations {
[code: string]: CardTranslation // "en" should always be there
}
interface CardTranslation {
name: string,
title: string?,
flavor: string?
}Each card, description, annotations can use placeholders, those are described in the placeholders.json.
It consists of a map of placeholder and their representations. Currently only for utf
{
"name": "value"
}
Holding lorcana data only
Raw JSON
You can access to the raw jsons inside data.
Gradle
A Kotlin Multiplatform library is available using
implementation("eu.codlab:lorcana-data:$version")This will work on the following platforms :
val lorcana = Lorcana().loadFromResources()
# load eiher from the resources or github, in this sample it'll be resources
The API will give you either the flatten list of cards or the condensed version. The difference between boths is that when using the condensed version, you will be able to get the various other versions of the card :
Get the list of flatten cards
val tfc = lorcana.set(SetDescription.TFC).cards
println("This will give you ${tfc.size} = 204+12 cards")
Get the list of virtual cards
val tfc = lorcana.set(SetDescription.TFC).virtualCards
println("This will give you ${tfc.size} = 204 cards")
The following is the definition for the Card, which are variant specific The cards are defined in the data folder
The model is as the following :
interface Card {
cost: int
inkwell: boolean
colors: InkColor[]
type: CardType
classification: ClassificationHolder[]
attack: int?
defence: int?
move_cost: int?
lore: int?
languages: CardTranslations
abilities: Ability[]
set: SetDescription
number: int
illustrator: string
dreamborn: string
ravensburger: string
rarity: VariantRarity
franchise: Franchise
third_party: CardThirdParty
}
The VirtualCard is an object which contains all the card information + every specific variant info in a sub-array which can then be used to make bijection on the cards themselves The model is as the following :
interface VirtualCard {
cost: int
inkwell: boolean
colors: InkColor[]
type: CardType
classification: ClassificationHolder[]
attack: int?
defence: int?
move_cost: int?
lore: int?
languages: CardTranslations
abilities: Ability[]
variants:
- set: SetDescription
number: int
illustrator: string
dreamborn: string
ravensburger: string
rarity: VariantRarity
franchise: Franchise
third_party: CardThirdParty
}interface Ability {
type: AbilityType,
title: TranslationHolder?,
text: TranslationHolder?,
ability: string?
}Those contains information which are country specific :
interface TranslationHolder {
[countryCode: string]: string? // "en" should always be there
}interface CardTranslations {
[code: string]: CardTranslation // "en" should always be there
}
interface CardTranslation {
name: string,
title: string?,
flavor: string?
}Each card, description, annotations can use placeholders, those are described in the placeholders.json.
It consists of a map of placeholder and their representations. Currently only for utf
{
"name": "value"
}