Changes according to Eslint

This commit is contained in:
Daniël van Noord
2021-03-16 09:32:50 +01:00
parent 26d8e75935
commit a65af049b6
63 changed files with 314 additions and 295 deletions

View File

@@ -34,12 +34,13 @@ export class CMAvgQueue {
* @returns {number} ret The average
*/
calcAverage(timePeriod) {
if (timePeriod > this.maxLength) timePeriod = this.maxLength;
if (timePeriod > this.queue.length) timePeriod = this.queue.length;
let time = timePeriod;
if (time > this.maxLength) time = this.maxLength;
if (time > this.queue.length) time = this.queue.length;
let ret = 0;
for (
let i = this.queue.length - 1;
i >= 0 && i > this.queue.length - 1 - timePeriod;
i >= 0 && i > this.queue.length - 1 - time;
i--
) {
ret += this.queue[i];
@@ -47,7 +48,7 @@ export class CMAvgQueue {
if (ret === 0) {
return 0;
}
return ret / timePeriod;
return ret / time;
}
}

View File

@@ -13,9 +13,9 @@ import {
export default function CacheCurrWrinklerCPS() {
CacheCurrWrinklerCPSMult = 0;
let count = 0;
for (const i in Game.wrinklers) {
if (Game.wrinklers[i].phase === 2) count++;
}
Object.keys(Game.wrinklers).forEach((i) => {
if (Game.wrinklers[i].phase === 2) count += 1;
});
let godMult = 1;
if (SimObjects.Temple.minigameLoaded) {
const godLvl = Game.hasGod('scorn');

View File

@@ -4,9 +4,9 @@
*/
export default function GetCPSBuffMult() {
let mult = 1;
for (const i of Object.keys(Game.buffs)) {
Object.keys(Game.buffs).forEach((i) => {
if (typeof Game.buffs[i].multCpS !== 'undefined')
mult *= Game.buffs[i].multCpS;
}
});
return mult;
}

View File

@@ -13,10 +13,10 @@ export default function CacheSellAllForChoEgg() {
if (Game.Objects.Bank.minigameLoaded) {
const marketGoods = Game.Objects.Bank.minigame.goods;
let goodsVal = 0;
for (const i of Object.keys(marketGoods)) {
Object.keys(marketGoods).forEach((i) => {
const marketGood = marketGoods[i];
goodsVal += marketGood.stock * marketGood.val;
}
});
sellTotal += goodsVal * Game.cookiesPsRawHighest;
}
// Compute cookies earned by selling all buildings with optimal auras (ES + RB)