aboutsummaryrefslogtreecommitdiff
path: root/utils.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'utils.mjs')
-rw-r--r--utils.mjs32
1 files changed, 10 insertions, 22 deletions
diff --git a/utils.mjs b/utils.mjs
index b8e5222..62569e4 100644
--- a/utils.mjs
+++ b/utils.mjs
@@ -29,28 +29,16 @@ export class Manager {
});
}
}
-}
-
-export function getMatchCount(regulars, courts) {
- const activeCourts = courts.filter(function (c) {
- return c.status;
- });
- console.log(
- "There are a total of " + activeCourts.length + " courts available."
- );
- console.log(regulars);
- const activePlayers = regulars.filter(function (p) {
- return p.status;
- });
- console.log(
- "There are a total of " + activePlayers.length + " players available."
- );
- var possibleMatches = Math.floor(activePlayers.length / 4);
- possibleMatches =
- possibleMatches > activeCourts.length
- ? activeCourts.length
- : possibleMatches;
- return possibleMatches;
+ active() {
+ return this.listData.filter(function (c) {
+ return c.status;
+ });
+ }
+ inactive() {
+ return this.listData.filter(function (c) {
+ return !c.status;
+ });
+ }
}
export function shuffle(array) {