1.2.1 • Published 8 years ago

tourney v1.2.1

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

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.

1.2.1

8 years ago

1.2.0

8 years ago

1.1.0

10 years ago

1.0.0

10 years ago

1.0.0-2

10 years ago

1.0.0-1

10 years ago

1.0.0-0

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago