deck

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Unlicense Imports: 3 Imported by: 3

Documentation

Index

Constants

View Source
const (
	MAINBOARD = "mainBoard"
	SIDEBOARD = "sideBoard"
	COMMANDER = "commanderBoard"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Deck

type Deck struct {
	Name        string       `json:"name"`
	Code        string       `json:"code"`
	Type        string       `json:"type"`
	ReleaseDate string       `json:"releaseDate"`
	Commander   []string     `json:"commander"`
	Mainboard   []string     `json:"mainBoard"`
	Sideboard   []string     `json:"sideBoard"`
	Contents    DeckContents `json:"contents"`
}

Deck - Represents a MTGJSON deck

Name (string) - The name of the deck Code (string) - A 3 or 4 digit code as an identifier for the deck Type (string) - The deck type ReleaseDate (string) - The release date of the deck CommanderIds (slice[string]) - A list of UUID's that represents the commander for the deck MainboardIds (slice[string]) - A list of UUID's that represents the main board for the deck SideboardIds (slice[string]) - A list of UUID's that represents the side board for the deck CommanderContents (slice[card.Card]) - A list of card models that represent the cards of the commander board MainboardContents (slice[card.Card]) - A list of card models that represent the cards of the main board SideBoardContents (slide[Card.Card]) - A list of card models that represent the side board

func (*Deck) AddCards

func (d *Deck) AddCards(uuids []string, board string) error

AddCards - Add a list of cards to a specific board within a deck. Card validation is not performed here as it is performed before this operation

Parameters: uuids (slice[string]) - A list of UUID's you want to add to your deck board (string) - The board you want to add to

Returns errors.ErrBoardNotExist - If the board does not exist

func (Deck) AllCardIds added in v1.0.3

func (d Deck) AllCardIds() []string

AllCards - Combine all boards into a list of UUID's

Parameters: None

Returns: allCard ([]string) - A list of all UUID's in the deck

func (Deck) CardExists

func (d Deck) CardExists(uuid string, board string) (bool, error)

CardExists - Ensure that a card exists on a specific board using a UUID

Parameters: uuid (string) - The uuid to check board (string) - The board you want to check. Can be either: mainBoard, sideBoard, commanderBoard

func (*Deck) DeleteCards

func (d *Deck) DeleteCards(uuids []string, board string) error

DeleteCards - Delete a list of cards to a specific board within a deck. Card validation is not performed here as it is performed before this operation

Parameters: uuids (slice[string]) - A list of UUID's you want to remove from your deck board (string) - The board you want to add to

Returns errors.ErrBoardNotExist - If the board does not exist

func (*Deck) GetBoard

func (d *Deck) GetBoard(board string) *[]card.Card

GetIdBoard - Returns a pointer to the slice that represents ids in the requested board

Parameters: board (string) - The board you want a pointer too

Returns *slice[string] - The board the caller requested

func (*Deck) GetIdBoard added in v1.0.3

func (d *Deck) GetIdBoard(board string) *[]string

GetIdBoard - Returns a pointer to the slice that represents ids in the requested board

Parameters: board (string) - The board you want a pointer too

Returns *slice[string] - The board the caller requested

type DeckContents added in v1.0.3

type DeckContents struct {
	Commander []card.Card `json:"commander"`
	Mainboard []card.Card `json:"mainBoard"`
	Sideboard []card.Card `json:"sideBoard"`
}

type DeckUpdate

type DeckUpdate struct {
	MainBoard []string `json:"mainBoard"`
	SideBoard []string `json:"sideBoard"`
	Commander []string `json:"commander"`
}

func (DeckUpdate) AllCards

func (d DeckUpdate) AllCards() []string

func (DeckUpdate) Count

func (d DeckUpdate) Count() int

Jump to

Keyboard shortcuts

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