diff options
Diffstat (limited to 'build/cleaners/skyblock/minions.js')
-rw-r--r-- | build/cleaners/skyblock/minions.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/build/cleaners/skyblock/minions.js b/build/cleaners/skyblock/minions.js index 289da1a..777db9b 100644 --- a/build/cleaners/skyblock/minions.js +++ b/build/cleaners/skyblock/minions.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.combineMinionArrays = exports.cleanMinions = void 0; +exports.countUniqueMinions = exports.combineMinionArrays = exports.cleanMinions = void 0; const hypixel_1 = require("../../hypixel"); /** * Clean the minions provided by Hypixel @@ -61,3 +61,12 @@ function combineMinionArrays(minions) { return resultMinions; } exports.combineMinionArrays = combineMinionArrays; +function countUniqueMinions(minions) { + let uniqueMinions = 0; + for (const minion of minions) { + // find the number of times `true` is in the list and add it to uniqueMinions + uniqueMinions += minion.levels.filter(x => x).length; + } + return uniqueMinions; +} +exports.countUniqueMinions = countUniqueMinions; |