deck

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: Unlicense Imports: 2 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 {
	Code        string   `json:"code"`
	Commander   []string `json:"commander"`
	MainBoard   []string `json:"mainBoard"`
	Name        string   `json:"name"`
	ReleaseDate string   `json:"releaseDate"`
	SideBoard   []string `json:"sideBoard"`
	Type        string   `json:"type"`
}

Deck - Represents a MTGJSON deck

Code (string) - A 3 or 4 digit code as an identifier for the deck Commander (slice[string]) - A list of UUID's that represents the commander for the deck Mainboard (slice[string]) - A list of UUID's that represents the main board for the deck Name (string) - The name of the deck ReleaseDate (string) - The release date of the deck Sideboard (slice[string]) - A list of UUID's that represents the side board for the deck Type (string) - The deck type

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) AllCards

func (d Deck) AllCards() []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) *[]string

GetBoard - Returns a pointer to the slice that represents the requested board

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

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

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