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

34 lines
1.0 KiB
Go

package game
// Card packs are the selectable sets of pets and food a game is played with.
// Turtle, Golden, and Unicorn all ship with full six-tier card data.
// 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: true},
{ID: "unicorn", Name: "Unicorn Pack", Emoji: "🦄", Playable: true},
}
// 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
}