Add basic deck builder #12

Merged
hamcha merged 42 commits from feature/deckbuilder into master 2019-09-12 09:11:32 +00:00
1 changed files with 10 additions and 2 deletions
Showing only changes of commit 761baaf461 - Show all commits

View File

@ -138,7 +138,8 @@ import {
CardSlot,
getCards,
allSets,
cardFullName
cardFullName,
createPonyheadURL
} from "@/mlpccg";
const colorNames = [
@ -410,7 +411,9 @@ export default class DeckBuilder extends Vue {
// Check if card is already in
const idx = this.decklist.findIndex(c => c.data.ID == card.ID);
if (idx >= 0) {
this.decklist[idx].howmany += 1;
const deckitem = this.decklist[idx];
deckitem.howmany += 1;
Vue.set(this.decklist, idx, deckitem);
} else {
this.decklist.push({
data: card,
@ -419,5 +422,10 @@ export default class DeckBuilder extends Vue {
});
}
}
private exportToPonyhead() {
const url = createPonyheadURL(this.decklist.map(c => c.data));
window.open(url, "_blank");
}
}
</script>