types

package
v0.0.0-...-b42093e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2018 License: MIT Imports: 2 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL