gen_int_decklist: translate decklist of card ID and count into LoR custom...

View source: R/decklist_handling.R

gen_int_decklistR Documentation

translate decklist of card ID and count into LoR custom encoding

Description

LoR uses a custom encoding scheme (laid out here) to store information about the cards (and their count) in any given deck as an integer vector. This function takes care of this.

Usage

gen_int_decklist(decklist)

Arguments

decklist

dataframe with character column cardcode adn numeric column count

Value

integer representation of deck code

Examples

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

lordecks:::gen_int_decklist(min_deck)

# returns  : "17" "1" "2" "1" "4" "8" "40" "0" "0"
# version/format 17 ("00010001"), last 4 bits are version (=1)
# 1 group of 3 copies
#    2 cards for combination of
#  1 set 1   and
#  4 faction 4 (PZ)
#      8   card code 01PZ008
#     40   card code 01PZ040
# 0 group of 2 copies
# 0 group if 1 copy

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