Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Card ¶
type Card struct { Name string `json:"name" validate:"required"` CMC float32 `json:"cmc" validate:"required"` Colors []string `json:"colors" validate:"required"` ManaCost string `json:"manaCost" validate:"required"` Type string `json:"type" validate:"required"` Text string `json:"text" validate:"required"` Power string `json:"power,omitempty" ` Toughness string `json:"toughness,omitempty"` Loyality int8 `json:"loyality,omitempty"` }
Card is a basic container for a Magic the Gathering Card Struct fields are based off https://mtgjson.com/documentation.html
type Collection ¶
type Collection []*Card
Collection is simply an array of cards
func (*Collection) Colours ¶
func (c *Collection) Colours() []string
Colours returns what different colours make up the collection
func (*Collection) CountType ¶
func (c *Collection) CountType(name string) int
CountType will return the number cards of given type
func (*Collection) ManaCurve ¶
func (c *Collection) ManaCurve() map[float32]int8
ManaCurve returns the manacost of the collection of cards stored in memory
Click to show internal directories.
Click to hide internal directories.