Documentation
¶
Index ¶
- Constants
- type Deck
- func (d *Deck) AddCards(uuids []string, board string) error
- func (d Deck) AllCardIds() []string
- func (d Deck) CardExists(uuid string, board string) (bool, error)
- func (d *Deck) DeleteCards(uuids []string, board string) error
- func (d *Deck) GetBoard(board string) *[]card.Card
- func (d *Deck) GetIdBoard(board string) *[]string
- type DeckContents
- type DeckUpdate
Constants ¶
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 ¶
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
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 ¶
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 ¶
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 ¶
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
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 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