aboutsummaryrefslogtreecommitdiff
path: root/src/cleaners/skyblock/minions.ts
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2021-02-13 16:03:49 -0600
committermat <27899617+mat-1@users.noreply.github.com>2021-02-13 16:03:49 -0600
commit43f194ff780d704834706ac6da454a8858098906 (patch)
treed22ca4d07b4adbbb7f1cc5dcc42663ab8934ac10 /src/cleaners/skyblock/minions.ts
parent604cf4233e3d69d7769d330c4f31876950a0e83d (diff)
downloadskyblock-api-43f194ff780d704834706ac6da454a8858098906.tar.gz
skyblock-api-43f194ff780d704834706ac6da454a8858098906.tar.bz2
skyblock-api-43f194ff780d704834706ac6da454a8858098906.zip
add minion_count
Diffstat (limited to 'src/cleaners/skyblock/minions.ts')
-rw-r--r--src/cleaners/skyblock/minions.ts11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/cleaners/skyblock/minions.ts b/src/cleaners/skyblock/minions.ts
index da69634..b5ac85d 100644
--- a/src/cleaners/skyblock/minions.ts
+++ b/src/cleaners/skyblock/minions.ts
@@ -67,4 +67,13 @@ export function combineMinionArrays(minions: CleanMinion[][]): CleanMinion[] {
}
return resultMinions
-} \ No newline at end of file
+}
+
+export function countUniqueMinions(minions: CleanMinion[]): number {
+ let uniqueMinions: number = 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
+}