clear console
This commit is contained in:
@@ -133,20 +133,16 @@ export class CheckMeterial {
|
|||||||
let dicStone = gameData.stone.get(id);
|
let dicStone = gameData.stone.get(id);
|
||||||
if(!dicStone || dicStone.composeMaterial.length <= 0) return false; // 1阶石头不能再从下合成返回不行
|
if(!dicStone || dicStone.composeMaterial.length <= 0) return false; // 1阶石头不能再从下合成返回不行
|
||||||
let materials = dicStone.composeMaterial.map(cur => ({...cur, count: cur.count * count }));
|
let materials = dicStone.composeMaterial.map(cur => ({...cur, count: cur.count * count }));
|
||||||
console.log('#######materials', materials)
|
|
||||||
let isEnough = await this.decrease(materials);
|
let isEnough = await this.decrease(materials);
|
||||||
console.log('#####isEnough', isEnough, this.notEnoughItems)
|
|
||||||
if(!isEnough) {
|
if(!isEnough) {
|
||||||
let notEnoughItems = this.getNotEnoughItems();
|
let notEnoughItems = this.getNotEnoughItems();
|
||||||
let newMaterials = this.getMaterialEnough(materials, notEnoughItems);
|
let newMaterials = this.getMaterialEnough(materials, notEnoughItems);
|
||||||
console.log('#######newMaterials', newMaterials, this.notEnoughItems)
|
|
||||||
let isEnough = await this.decrease(newMaterials); // 消耗掉除了不足的部分以外的其他部分
|
let isEnough = await this.decrease(newMaterials); // 消耗掉除了不足的部分以外的其他部分
|
||||||
if(!isEnough) return false;
|
if(!isEnough) return false;
|
||||||
|
|
||||||
let isAllOK = true; // 如果有石头不足,向下补充,isAllOK标识不足的都能补充上
|
let isAllOK = true; // 如果有石头不足,向下补充,isAllOK标识不足的都能补充上
|
||||||
for(let [id, count] of notEnoughItems) {
|
for(let [id, count] of notEnoughItems) {
|
||||||
let isEnough = await this.composeStone(id, count);
|
let isEnough = await this.composeStone(id, count);
|
||||||
console.log('####')
|
|
||||||
if(!isEnough) {
|
if(!isEnough) {
|
||||||
isAllOK = false; break;
|
isAllOK = false; break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user