Skip to content

Yutsa/runeterra-deck-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

runeterra-deck-code

This project is a Java implementation to encode and decode Legends of Runeterra deck codes.

It is based on the reference implementation from Riot Games.

Creating a Deck instance

To build an instance of Deck to encode, a builder is available. It has a pretty simple API with two ways to add cards to a deck :

The first way is to add a card from its code :

Deck deck = Deck.builder()
                .addCard("01DE001", 3)
                .addCard("02MT023", 1)
                .build();

The other way is to add a card directly from an instance of Card :

Card card = Card.fromCode("01DE001");
Deck deck2 = Deck.builder()
                 .addCard(card, 3)
                 .build();

Encoding a Deck

String deckCode = new DeckEncoder().encode(deck);

Decoding a Deck

Deck deck = new DeckEncoder().decode(deckCode);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published