36 lines
1.1 KiB
Go
36 lines
1.1 KiB
Go
package game
|
|
|
|
// Card packs are the selectable sets of pets and food a game is played with.
|
|
// Turtle and Golden ship with full card data; Unicorn is 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: true},
|
|
{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
|
|
}
|