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:
@@ -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
|
||||
|
Reference in New Issue
Block a user