get_code_from_decklist: Generate a shareable deck code from a decklist

View source: R/highlevel_functions.R

get_code_from_decklistR Documentation

Generate a shareable deck code from a decklist

Description

Deck lists are stored and shared in an RFC 4648 base-32 code. This top-level functions take the cards and their count , and encode them according to the rules (laid out here)

Usage

get_code_from_decklist(decklist)

get_code_from_decklist_df(decklist_df)

Arguments

decklist

character vector of decklist with format '{count}:{cardcode}'

decklist_df

dataframe with character column cardcode and numeric column count

Value

character deck code in base 32 (RFC 4648)

Examples

#minimalist example (obviously incomplete deck)
min_deck <- data.frame(
  "cardcode" = c("01PZ008", "01PZ040"),
  "count" = c(3, 3)
)

get_code_from_decklist(c("3:01PZ008", "3:01PZ040"))
# returns "CEAQEAIEBAUAAAA"#'

get_code_from_decklist_df(min_deck)
# returns "CEAQEAIEBAUAAAA"

pholzmgit/lordecks documentation built on May 23, 2022, 11:03 a.m.