Add support for MLP promo cards
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Hamcha 2019-08-23 16:57:53 +02:00
parent e9e5ffdada
commit 0e2c613375
2 changed files with 15 additions and 0 deletions

View file

@ -50,9 +50,19 @@ func LoadCardList(list []string, fetch bool) (out []Card, err error) {
err = ErrInvalidCardID err = ErrInvalidCardID
return return
} }
// Get Set ID // Get Set ID
setid := SetID(strings.ToUpper(card[:2])) setid := SetID(strings.ToUpper(card[:2]))
// Check for promo card
for _, promoid := range promoIDs {
if strings.ToLower(card) == promoid {
card = strings.ToLower(card)
setid = "promo"
break
}
}
// Get set // Get set
var set *Set var set *Set
if fetch { if fetch {

5
mlp/promo.go Normal file
View file

@ -0,0 +1,5 @@
package mlp
var promoIDs = []string{
"prpf1", "prpf2", "prpf3", "prpf4", "prpf6", "cnpf3", "cnpf5", "cnpf7", "cnpf9", "cnpf11", "cnpf13", "cgpf4", "cgpf6", "cgpf8", "cgpf11", "cgpf12", "cgpf14", "gf1", "gf4", "gf5", "gf7", "gf9",
}