Add lobby and pack concept.

This commit is contained in:
Greyson Parrelli
2026-07-23 22:01:54 -04:00
parent 9d9acc4577
commit e74f983470
18 changed files with 665 additions and 111 deletions
+15 -4
View File
@@ -482,12 +482,23 @@ func (g *Game) newCardID() string {
return fmt.Sprintf("c%d", g.NextCardID)
}
// buildShopDecks creates all six tier decks (unshuffled).
// packTiers returns the pet and food templates for a pack, tier by tier. Only
// the Turtle pack has real data today; the other (not-yet-playable) packs fall
// back to it so this is the single seam future packs plug their cards into.
func packTiers(pack string) (*[MaxRounds][]petTemplate, *[MaxRounds][]foodTemplate) {
switch pack {
default: // turtle (and the placeholder packs, until they ship)
return &petTiers, &foodTiers
}
}
// buildShopDecks creates all six tier decks (unshuffled) for the game's pack.
func (g *Game) buildShopDecks() {
pets, foods := packTiers(g.Pack)
g.ShopDecks = make([][]Card, MaxRounds)
for tierIdx := range petTiers {
for tierIdx := range pets {
var deck []Card
for _, t := range petTiers[tierIdx] {
for _, t := range pets[tierIdx] {
for _, suit := range t.Suits {
deck = append(deck, Card{
ID: g.newCardID(),
@@ -501,7 +512,7 @@ func (g *Game) buildShopDecks() {
})
}
}
for _, f := range foodTiers[tierIdx] {
for _, f := range foods[tierIdx] {
for range f.Copies {
deck = append(deck, Card{
ID: g.newCardID(),