package tome_game import ( . "git.saintnet.tech/tomecraft/tome_lib" "github.com/google/uuid" ) func NewDeck(owner int) *Deck { cards := []*Card{} for i := 0; i < 3; i++ { for j := 1; j < 9; j++ { cards = append(cards, NewCard(j, owner, -1, uuid.Nil)) } } cards = append(cards, NewCard(0, owner, -1, uuid.Nil)) return &Deck{ Cards: cards, } } func LoadDeck(owner int, cards []int) *Deck { if len(cards) == 0 { return NewDeck(owner) } d := []*Card{} for _, v := range cards { d = append(d, NewCard(v, owner, -1, uuid.Nil)) } return &Deck{ Cards: d, } } func ValidateDeck(cards []int) bool { if len(cards) < 15 { return false } for _, v := range cards { if !CardType(v).IsACardType() { return false } if OracleToken(CardType(v), nil) { return false } } return true }