Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion js/decklist/decklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ var Decklist = {
main: [
/^\s*(\d+)\s+\[.*\]\s+(.+?)\s*$/, // MWS, what an ugly format
/^\s*(\d+)x*\s(.+?)\s*$/, // MTGO deck format (4 Brainstorm) also TCG (4x Brainstorm)
/^\s*()?(.+?)\s*$/, // Single card
],
side: [
/^\s*SB:\s*(\d+)\s+\[.*\]\s(.+?)\s*$/, // MWS, what an ugly format
/^\s*SB:\s+(\d+)\s(.+?)\s*$/, // Sideboard lines begin with SB:
/^\s*()?(.+?)\s*$/, // Single card
Comment thread
ggekos marked this conversation as resolved.
Outdated
],
};

Expand Down Expand Up @@ -76,7 +78,7 @@ var Decklist = {
}

let result = re.exec(line),
quantity = parseInt(result[1]),
quantity = parseInt(result[1]) ? parseInt(result[1]) : 1,
Comment thread
ggekos marked this conversation as resolved.
Outdated
cardName = result[2],
card = getCard(cardName);
// add quantity field to card object
Expand Down