Skip to content

Artifact Card Game Deck Code based on the original api code written in PHP.

License

Notifications You must be signed in to change notification settings

exts/ArtifactDeckCodeGo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ArtifactDeckCodeGo

Artifact Card Game Deck Code Encoder & Decoder based on the original api code written in PHP.

Installation

go get github.com/exts/ArtifactDeckCodeGo

Example Decode Usage

// cardDeck returns a CardDeck struct reference
cardDeck, err := ArtifactDeckCodeGo.ParseDeck("ADCJQEAZX0ivAGABwA4XSXdAUEGQgEFAmIBRF0BDAkYAQUHAwEIBSQBMQFwASgBTw__")
if err != nil {
	// handle error
}

// cardDeck.name => string
// cardDeck.heroes => []Card
// cardDeck.cards => []Card

Example Encode Usage

Encoding takes a CardDeck struct reference and spits out a deck code string. So provide the CardDeck struct with a full 40 card deck + 9 items and then 5 heroes and excluding signature cards (hero cards) to get a proper deck code back.

// starter deck
codeStr := "ADCJQEAZX0ivAGABwA4XSXdAUEGQgEFAmIBRF0BDAkYAQUHAwEIBSQBMQFwASgBTw__"
cardDeck, err := ArtifactDeckCodeGo.ParseDeck(codeStr)
if err != nil {
	// handle error
}

deckCode, err := ArtifactDeckCodeGo.EncodeDeck(cardDeck)
if err != nil {
	// handle error
}

println(codeStr == deckCode) // true

Notes

  • Use card database to cross reference hero card id's to get the missing hero signature cards (each hero has a certain number of additional cards paired with them)

About

Artifact Card Game Deck Code based on the original api code written in PHP.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages