diff options
| author | Karan Jayachandra <karan.jayachandra@nxp.com> | 2025-11-13 11:58:42 +0100 |
|---|---|---|
| committer | Karan Jayachandra <karan.jayachandra@nxp.com> | 2025-11-13 11:58:42 +0100 |
| commit | 05d2f2f943921d6b5c921686c5edce6eb39d23b8 (patch) | |
| tree | aa49a02006d88f44a57864a51e680f87ef341a7c /utils.mjs | |
| parent | 367dacb5057c945027775f992edf69884c8fb650 (diff) | |
Cleaned up the code quite a bit
Diffstat (limited to 'utils.mjs')
| -rw-r--r-- | utils.mjs | 32 |
1 files changed, 10 insertions, 22 deletions
@@ -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) { |
