Skip to content

Legends of Runeterra deck/card code encoder/decoder in Nim.

License

Notifications You must be signed in to change notification settings

SolitudeSF/runeterra_decks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

runeterra_decks

Legends of Runeterra deck/card code encoder/decoder and card infomation provider in Nim.

Example usage

import runeterra_decks/[cards, codes]


let code = "CEBAIAYGAQDQQDYHAMER2IZNGM2DOVICAEBQMCICAMETYYQBAEBQSEY"
var (deck, format, version) = parseDeck code

echo deck[10].code

deck[5].card = Card(`set`: 1, faction: Noxus, number: 5)

echo deck.serialize

Card info

You can query card info using runeterra_decks/info module which provides getInfo procedures. This significantly increases binary size.

echo deck[5].getInfo.name

if deck[0].getInfo.supertype == csupChampion:
  echo deck[0].getInfo.levelupDescription

for cards in deck:
  let info = cards.getInfo
  if csubSpider in info.subtypes and info.cost > 2:
    echo info.name

Or you can query entire runeterra library.

import tables, runeterra_decks/[info, cards]

for card, info in runeterraLibrary:
  if DoubleStrike in info.keywords:
    echo info

About

Legends of Runeterra deck/card code encoder/decoder in Nim.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages