1
0
mirror of https://github.com/exane/not-gwent-online synced 2025-09-05 22:07:42 +00:00

display correct deck list

This commit is contained in:
devfake
2015-06-25 15:18:44 +02:00
parent 6b1625166a
commit 9296a6b934
4 changed files with 60 additions and 30 deletions

View File

@@ -8,7 +8,7 @@ module.exports = {
data: function() {
return {
cards: [],
deck: {},
deck: [],
leaders: [],
leader: null,
@@ -22,6 +22,18 @@ module.exports = {
this.initDeck();
},
filters: {
getType: function(c, type) {
var tmp = $.map(c, (item) => {
if(item.type == type) return item;
});
return tmp;
return c;
}
},
methods: {
changeDeck: function(deck) {
// todo: load animation
@@ -45,11 +57,13 @@ module.exports = {
},
initDeck: function() {
this.deck = {};
this.deck = [];
var _deck = deck[this.factionFilter];
for(var item in _deck) {
this.deck.push(cards[_deck[item]]);
}
deck[this.factionFilter].forEach((x) => {
this.deck[x] = (this.deck[x] || 0) + 1;
});
},
// test