JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 15
  • Score
    100M100P100Q35751F
  • License MIT

Multi-stage tournaments

Package Exports

  • tourney

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tourney) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Tourney

npm status build status dependency status coverage status

This module provides a way to glue together tournament like building blocks (or even other tourneys) to create larger tourneys that does not have tournament's pre-determined match size restriction.

As this library does not provide anything but an interface, it is probably easiest to understand by seeing some implementions:

Usage

You should read at least one of:

The short of it is that you can use any implementation like if it was a Tournament, but with extra stage separation:

var MyTourney = require('./mytrn.js')

// suppose MyTourney has 3 stages:
// 1. GroupStage
// 2. FFA
// 3. Duel
var opts = {
  groupStage: { groupSize: 4, limit: 16 }, // want the top 16 to proceed to Ffa
  ffa: { sizes: [4, 4], advancers: [2], limit: 4 }, // top 4 to Duel stage
  duel: { last: Duel.LB }
}
var trn = new MyTourney(32, opts);

// then:
trn.matches; // gives you the current stage (groupstage first)
trn.score(trn.matches[i].id, [1,0]); // score a match like a tournament

// when all scored:
trn.stageDone(); // true
trn.createNextStage();
trn.matches; // either round 1 of FFA or tiebreakers for the groupstage

// keep scoring and making next stages until:
trn.isDone(); // cannot create more stages now
trn.complete(); // lock down state

License

MIT-Licensed. See LICENSE file for details.