Code Monkey home page Code Monkey logo

artifactdeckcodedotnet's Introduction

ArtifactDeckCodeDotNet NuGet

A C# port of ArtifactDeckCode

Refer to that page for more detailed information on Artifact Deck Codes.

Documentation

Decoder

ParseDeck returns a Deck object with contains a list of Heroes(ids and turn numbers), Cards(ids and count), and the deck Name.

Deck deck = ArtifactDeckDecoder.ParseDeck("ADCJWkTZX05uwGDCRV4XQGy3QGLmqUBg4GQJgGLGgO7AaABR3JlZW4vQmxhY2sgRXhhbXBsZQ__");
Console.WriteLine(deck.Name); // outputs "Green/Black Example"

Encoder

EncodeDeck returns a string. This string is the ArtifactDeckCode.

Deck deck = new Deck();
deck.Name = "my sweet deck";
deck.Heroes = new List<Hero>();
deck.Cards = new List<Card>();
deck.Heroes.Add(new Hero { Id = 4005, Turn = 1 });
deck.Heroes.Add(new Hero { Id = 10014, Turn = 1 });
deck.Cards.Add(new Card { Id = 3001, Count = 1 });
deck.Cards.Add(new Card { Id = 10165, Count = 3 });

...

string deckCode = ArtifactDeckEncoder.EncodeDeck(deck);
Console.WriteLine(deckCode); // outputs URL safe deck code string

CardSetApiClient

The CardSetApiClient allows you to request details on all cards in Artifact by set id. Currently 0 and 1 are the only valid set ids.

using(var apiClient = new CardSetApiClient())
{
    CardSet cardSet = await client.GetCardSetAsync(0);

    Console.WriteLine(cardSet.Version); //outputs "1"
    Console.WriteLine(cardSet.SetInfo.Name.English); //outputs "Base Set"
    Console.WriteLine(string.Join(", ", cardSet.CardList
      .Skip(15)
      .Take(3)
      .Select(x => x.CardName.English))); //outputs "Town Portal Scroll, Fahrvhan the Dreamer, Pack Leadership"
}

artifactdeckcodedotnet's People

Contributors

asimonov-im avatar misterjimson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.