diff options
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) { |
