Skip to content

A Swift library to decode & encode Legends of Runeterra decks into strings that can be imported into the game client.

License

Notifications You must be signed in to change notification settings

sekimondre/RuneterraDecks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RuneterraDecks

Decks in Legends of Runeterra can be converted into and from a Base32 string that can be easily used to share decks with other players and game clients.

Decoding & Encoding

A deck is represented by a list of card entries. Each entry specify a single card by its corresponding code and how many copies are present in the deck.

The library supports up the the Call of the Mountain (Targon) expansion set. It also supports special case decks with 4+ copies of a card.

Decoding:

This is an example decoding my favorite Jinx & Draven deck:

import RuneterraDecks

let deckCode = "CEBAGAIDCQRSOCIBAQAQYEQ4EYTSQLJUAIAQCAYLAEAQIDIA"
let cardEntries = try? DeckDecoder.decode(deckCode)

Encoding:

To encode a deck, just create an Entry array for the cards and pass is to the encoder:

import RuneterraDecks

// Add your card entries to an array in any way you like
let cards: [Entry] = [Entry(cardCode: "01NX020", count: 3), ... ] 
let code = try? DeckEncoder.encode(cards)

About

A Swift library to decode & encode Legends of Runeterra decks into strings that can be imported into the game client.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages