Files
super-auto-pets-board-game/internal/game/packs.go
T

36 lines
1.2 KiB
Go

package game
// Card packs are the selectable sets of pets and food a game is played with.
// Only the Turtle pack ships with real card data today; Golden and Unicorn are
// declared here as infrastructure (shown but not yet playable) so the lobby,
// views, and deck-building all have a single source of truth to grow into.
// PackInfo describes one selectable pack. Playable gates whether a lobby may
// choose it and start a game with it.
type PackInfo struct {
ID string `json:"id"`
Name string `json:"name"`
Emoji string `json:"emoji"`
Playable bool `json:"playable"`
}
// DefaultPack is the pack a freshly created game starts on.
const DefaultPack = "turtle"
// Packs is the ordered catalog of packs shown in the lobby.
var Packs = []PackInfo{
{ID: "turtle", Name: "Turtle Pack", Emoji: "🐢", Playable: true},
{ID: "golden", Name: "Golden Pack", Emoji: "🥇", Playable: false},
{ID: "unicorn", Name: "Unicorn Pack", Emoji: "🦄", Playable: false},
}
// packByID looks up a pack, returning false if the id is unknown.
func packByID(id string) (PackInfo, bool) {
for _, p := range Packs {
if p.ID == id {
return p, true
}
}
return PackInfo{}, false
}