1.0.15 • Published 6 years ago

@playfusion/warhammer-deck-sharing v1.0.15

Weekly downloads
1
License
ISC
Repository
gitlab
Last release
6 years ago

Warhammer Age of Sigmar: Champions Deck Sharing

Generate and parse deck sharing codes.

Require

To require the module

npm install --save @playfusion/warhammer-deck-sharing

Then import/require using your module loader of choice.

This module is compatible with NodeJS and browser environments.

Browserify example

// main.js
var deckSharing = require("@playfusion/warhammer-deck-sharing")
deckSharing.generate([{id: 123, count: 1}, {id: 234, count: 2}])

then

browserify main.js -o dist.js

Generate deck codes

To create a deck code

    import {generate} from "@playfusion/warhammer-deck-sharing"
    
    const deck = [
        {id: -276130957, count: 1},
        {id: -1050439153, count: 1},
        {id: -513512609, count: 2}
    ]
    generate(deck) // => _wEBD5JjwQJfa2ThAXOTiu8=

Using a generated deck code to link to the app

    <a href="warhammer-tcg://share-deck?_wEBD5JjwQJfa2ThAXOTiu8=&amp;deepLinkTimestamp=1540311920029">Open in game</a>

Parse deck codes

To parse a deck code

    import {parse} from "@playfusion/warhammer-deck-sharing"
    
    const deck = parse("_wEBD5JjwQJfa2ThAXOTiu8=")
    // =>
    // [
    //  {id: -276130957, count: 1},
    //  {id: -1050439153, count: 1},
    //  {id: -513512609, count: 2}
    // ]

You can then use these ids against the card data API to get full card data.

Bugs & Feedback

If you spot any issues or have any feedback, please get in touch via our official Discord channel using the #playfusion-feedback channel.

1.0.15

6 years ago

1.0.14

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago