import {ZONE_MAIN, ZONE_SIDEBOARD} from "../zones";

export default {
  name: "Text",
  download: text,
  downloadExtension: ".txt",
  copy: text
};

function text (name, deck) {
  return [
    ...deck[ZONE_MAIN].map(renderCopyCard),
    "Sideboard",
    ...deck[ZONE_SIDEBOARD].map(renderCopyCard),
  ].join("\n");
}

function renderCopyCard ({ count, card }) {
  return `${count} ${correctName(card)}`;
}

function correctName (card) {
  return card.name;
}

@@ -183,16 +183,28 @@
 eturn %5B%0A
+    %22Deck%22,%0A
     ...d
@@ -239,16 +239,24 @@
 yCard),%0A
+    %22%22,%0A
     %22Sid

prettify text export