修复回滚
This commit is contained in:
parent
5395483b60
commit
0f642a46bf
23
game/game.js
23
game/game.js
|
@ -24751,9 +24751,32 @@
|
||||||
getExpansions:function(tag){
|
getExpansions:function(tag){
|
||||||
return this.getCards('x',(card)=>card.hasGaintag(tag));
|
return this.getCards('x',(card)=>card.hasGaintag(tag));
|
||||||
},
|
},
|
||||||
|
countExpansions:function(tag){
|
||||||
|
return this.getExpansions(tag).length;
|
||||||
|
},
|
||||||
|
hasExpansions:function(tag){
|
||||||
|
return this.countExpansions(tag)>0;
|
||||||
|
},
|
||||||
|
setStorage:function(name,value){
|
||||||
|
return this.storage[name]=value;
|
||||||
|
},
|
||||||
getStorage:function(name){
|
getStorage:function(name){
|
||||||
return this.storage[name]||[];
|
return this.storage[name]||[];
|
||||||
},
|
},
|
||||||
|
hasStorage:function(name){
|
||||||
|
return name in this.storage;
|
||||||
|
},
|
||||||
|
initStorage:function(name,value){
|
||||||
|
return this.hasStorage(name)?this.getStorage(name):this.setStorage(name,value);
|
||||||
|
},
|
||||||
|
updateStorage:function(name,operation){
|
||||||
|
return this.setStorage(name,operation(this.getStorage(name)));
|
||||||
|
},
|
||||||
|
updateStorageAsync:function(name,operation){
|
||||||
|
return Promise.resolve(this.getStorage(name))
|
||||||
|
.then(value=>operation(value))
|
||||||
|
.then(value=>this.setStorage(name,value))
|
||||||
|
},
|
||||||
markSkill:function(name,info,card){
|
markSkill:function(name,info,card){
|
||||||
if(info===true){
|
if(info===true){
|
||||||
this.syncStorage(name);
|
this.syncStorage(name);
|
||||||
|
|
Loading…
Reference in New Issue