mtg

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2020 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MagicPlugin = magicPlugin{
	// contains filtered or unexported fields
}

MagicPlugin is the exported plugin for this package

Functions

This section is empty.

Types

type CardInfo

type CardInfo struct {
	// Name of the card.
	Name string
	// Set of the card.
	Set *string
}

CardInfo contains the name of a card and its set.

type CardNames

type CardNames struct {
	// Names are the card names.
	Names []CardInfo
	// Counts is a map of card name to count (number of this card in the deck).
	Counts map[string]int
}

CardNames contains the card names and their count.

func NewCardNames

func NewCardNames() *CardNames

NewCardNames creates a new CardNames struct.

func (*CardNames) Count

func (c *CardNames) Count(name string, set *string) int

Count return the number of cards for a given name and set (optional).

func (*CardNames) Insert

func (c *CardNames) Insert(name string, set *string)

Insert a new card in a CardNames struct.

func (*CardNames) InsertCount

func (c *CardNames) InsertCount(name string, set *string, count int)

InsertCount inserts several new cards in a CardNames struct.

func (*CardNames) String

func (c *CardNames) String() string

String representation of a CardNames struct.

type CockatriceCard

type CockatriceCard struct {
	XMLName xml.Name `xml:"card"`
	Number  int      `xml:"number,attr"`
	Name    string   `xml:"name,attr"`
}

CockatriceCard represents a specific card in a Cockatrice deck file

type CockatriceDeck

type CockatriceDeck struct {
	XMLName  xml.Name         `xml:"cockatrice_deck"`
	Version  int              `xml:"version,attr"`
	Name     string           `xml:"deckname"`
	Comments string           `xml:"comments"`
	Zones    []CockatriceZone `xml:"zone"`
}

CockatriceDeck is the main tag in a Cockatrice deck file (.cod)

type CockatriceZone

type CockatriceZone struct {
	XMLName xml.Name         `xml:"zone"`
	Name    string           `xml:"name,attr"`
	Cards   []CockatriceCard `xml:"card"`
}

CockatriceZone is a Cockatrice deck zone (usually "main" or "side")

type DeckType

type DeckType int

DeckType is the type of a parsed deck.

const (
	// Main deck
	Main DeckType = iota
	// Sideboard deck
	Sideboard
	// Maybeboard cards
	Maybeboard
)

Jump to

Keyboard shortcuts

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