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 k, v := range cards { d[k] = NewCard(v, owner, -1, uuid.Nil) } return &Deck{ Cards: d, } } func ValidateDeck(cards []int) bool { for _, v := range cards { if CardType(v).IsACardType() { return false } } return true }