Recommend this page to a friend! |
Download .zip |
Info | View files (242) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2021-05-26 (3 months ago) | Not yet rated by the users | Total: 248 This week: 1 | All time: 7,857 This week: 174 |
Version | License | PHP version | Categories | |||
tournament-generator 0.4 | Custom (specified... | 7.4 | Games, PHP 7 |
Description | Author | ||||||||
This package can be used to organize the matches of teams in a tournament. |
|
<h1 align="center"> <br> Tournament Generator <br> </h1>
<h4 align="center">A set of multiple classes to generate and work with all different kinds of tournament brackets or defining a custom bracket.</h4>
<p align="center"> <a href="https://packagist.org/packages/heroyt/tournament-generator"><img src="https://poser.pugx.org/heroyt/tournament-generator/v/stable" alt="Latest Stable Version"></a> <a href="https://packagist.org/packages/heroyt/tournament-generator"><img src="https://poser.pugx.org/heroyt/tournament-generator/downloads" alt="Total Downloads"></a> <a href="https://scrutinizer-ci.com/g/heroyt/tournament-generator/?branch=master"><img src="https://scrutinizer-ci.com/g/heroyt/tournament-generator/badges/quality-score.png?b=master" alt="Scrutinizer Code Quality" data-canonical-src="https://scrutinizer-ci.com/g/heroyt/tournament-generator/badges/quality-score.png?b=master" style="max-width:100%;"></a> <a href="https://scrutinizer-ci.com/g/Heroyt/tournament-generator/build-status/master"><img src="https://scrutinizer-ci.com/g/Heroyt/tournament-generator/badges/build.png?b=master" alt="Scrutinizer Build" data-canonical-src="https://scrutinizer-ci.com/g/Heroyt/tournament-generator/badges/build.png?b=master" style="max-width:100%;"></a> <a href="(https://scrutinizer-ci.com/g/Heroyt/tournament-generator/?branch=master"><img src="https://scrutinizer-ci.com/g/Heroyt/tournament-generator/badges/coverage.png?b=master" alt="Code Coverage" data-canonical-src="https://scrutinizer-ci.com/g/heroyt/tournament-generator/badges/quality-score.png?b=master" style="max-width:100%;"></a> <a href='https://tournament-generator.readthedocs.io/en/latest/?badge=latest'>
<img src='https://readthedocs.org/projects/tournament-generator/badge/?version=latest' alt='Documentation Status' />
</a>
</p>
$ composer require heroyt/tournament-generator
require 'vendor/autoload.php';
// Create a tournament
$tournament = new TournamentGenerator\Tournament('Tournament name');
// Set tournament lengths - could be omitted
$tournament
->setPlay(7) // SET GAME TIME TO 7 MINUTES
->setGameWait(2) // SET TIME BETWEEN GAMES TO 2 MINUTES
->setRoundWait(0); // SET TIME BETWEEN ROUNDS TO 0 MINUTES
// Create a round and a final round
$round = $tournament->round("First's round's name");
$final = $tournament->round("Final's round's name");
// Create 2 groups for the first round
$group_1 = $round->group('Round 1')
->setInGame(2) // 2 TEAMS PLAYING AGAINST EACH OTHER
->setType(TournamentGenerator\Constants::ROUND_ROBIN); // ROBIN-ROBIN GROUP
$group_2 = $round->group('Round 2')
->setInGame(2) // 2 TEAMS PLAYING AGAINST EACH OTHER
->setType(TournamentGenerator\Constants::ROUND_ROBIN); // ROBIN-ROBIN GROUP
// Create a final group
$final_group = $final->group('Finale')
->setInGame(2) // 2 TEAMS PLAYING AGAINST EACH OTHER
->setType(TournamentGenerator\Constants::ROUND_ROBIN); // ROBIN-ROBIN GROUP
// CREATE 6 TEAMS
for ($i=1; $i <= 6; $i++) {
$tournament->team('Team '.$i);
}
// SET PROGRESSIONS FROM GROUP 1 AND 2 TO FINAL GROUP
$group_1->progression($final_group, 0, 2); // PROGRESS 2 BEST WINNING TEAMS
$group_2->progression($final_group, 0, 2); // PROGRESS 2 BEST WINNING TEAMS
// Generate games in the first round
$round->genGames();
// Simulate results (or you can fill it with your own real results)
$round->simulate();
// Progress best teams from first round to final round
$round->progress();
// Generate games in the final round
$final->genGames();
// Simulate results (or you can fill it with your own real results)
$final->simulate();
// GET ALL TEAMS
$teams = $tournament->getTeams(true); // TRUE to get teams ordered by their results
require 'vendor/autoload.php';
// Create a tournament
$tournament = new TournamentGenerator\Preset\SingleElimination('Tournament name');
// Set tournament lengths - could be omitted
$tournament
->setPlay(7) // SET GAME TIME TO 7 MINUTES
->setGameWait(2) // SET TIME BETWEEN GAMES TO 2 MINUTES
->setRoundWait(0); // SET TIME BETWEEN ROUNDS TO 0 MINUTES
// CREATE 6 TEAMS
for ($i=1; $i <= 6; $i++) {
$tournament->team('Team '.$i);
}
// GENERATE ALL GAMES
$tournament->generate();
// Simulate games
$tournament->genGamesSimulate(); // Simulate only games for example to only save bracket to DB
$tournament->genGamesSimulateReal(); // Simulate games with results like a real tournament
// GET ALL TEAMS
$teams = $tournament->getTeams(true); // TRUE to get teams ordered by their results
Files |
File | Role | Description | ||
---|---|---|---|---|
.github (1 directory) | ||||
build (2 files) | ||||
docs (1 file, 9 directories) | ||||
src (1 directory) | ||||
tests (3 files, 6 directories) | ||||
wiki (1 file, 2 directories) | ||||
.travis.yml | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
Doxyfile | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
mkdocs.yml | Data | Auxiliary data | ||
phpdoc.dist.xml | Data | Auxiliary data | ||
phpunit.xml | Data | Auxiliary data | ||
readme.md | Data | Read me |
Files | / | build |
File | Role | Description |
---|---|---|
coverage.serialized | Example | Example script |
coverage.xml | Data | Auxiliary data |
Files | / | docs |
File | Role | Description | ||
---|---|---|---|---|
classes (51 files) | ||||
css (3 files) | ||||
files (59 files) | ||||
graphs (2 files) | ||||
indices (1 file) | ||||
js (2 files) | ||||
namespaces (9 files) | ||||
packages (9 files) | ||||
reports (3 files) | ||||
index.html | Doc. | Documentation |
Files | / | docs | / | classes |
Files | / | docs | / | css |
File | Role | Description |
---|---|---|
base.css | Data | Auxiliary data |
normalize.css | Data | Auxiliary data |
template.css | Data | Auxiliary data |
Files | / | docs | / | files |
Files | / | docs | / | graphs |
File | Role | Description |
---|---|---|
classes.html | Doc. | Documentation |
classes.svg | Data | Auxiliary data |
Files | / | docs | / | js |
File | Role | Description |
---|---|---|
search.js | Data | Auxiliary data |
searchIndex.js | Data | Auxiliary data |
Files | / | docs | / | namespaces |
File | Role | Description |
---|---|---|
default.html | Doc. | Documentation |
tournamentgenerator-containers.html | Doc. | Documentation |
tournamentgenerator-export.html | Doc. | Documentation |
tournamentgenerator-helpers-sorter.html | Doc. | Documentation |
tournamentgenerator-helpers.html | Doc. | Documentation |
tournamentgenerator-interfaces.html | Doc. | Documentation |
tournamentgenerator-preset.html | Doc. | Documentation |
tournamentgenerator-traits.html | Doc. | Documentation |
tournamentgenerator.html | Doc. | Documentation |
Files | / | docs | / | packages |
File | Role | Description |
---|---|---|
default.html | Doc. | Documentation |
TournamentGenerator-Containers.html | Doc. | Documentation |
TournamentGenerator-Export.html | Doc. | Documentation |
TournamentGenerator-Helpers-Sorter.html | Doc. | Documentation |
TournamentGenerator-Helpers.html | Doc. | Documentation |
TournamentGenerator-Interfaces.html | Doc. | Documentation |
TournamentGenerator-Preset.html | Doc. | Documentation |
TournamentGenerator-Traits.html | Doc. | Documentation |
TournamentGenerator.html | Doc. | Documentation |
Files | / | docs | / | reports |
File | Role | Description |
---|---|---|
deprecated.html | Doc. | Documentation |
errors.html | Doc. | Documentation |
markers.html | Doc. | Documentation |
Files | / | src | / | TournamentGenerator |
File | Role | Description | ||
---|---|---|---|---|
Containers (6 files) | ||||
Export (7 files) | ||||
Helpers (6 files, 1 directory) | ||||
Interfaces (8 files) | ||||
Preset (5 files) | ||||
Traits (9 files) | ||||
Base.php | Class | Class source | ||
BlankTeam.php | Class | Class source | ||
Category.php | Class | Class source | ||
Constants.php | Class | Class source | ||
Game.php | Class | Class source | ||
Group.php | Class | Class source | ||
HierarchyBase.php | Class | Class source | ||
index.php | Aux. | Auxiliary script | ||
Progression.php | Class | Class source | ||
Round.php | Class | Class source | ||
Team.php | Class | Class source | ||
TeamFilter.php | Class | Class source | ||
Tournament.php | Class | Class source |
Files | / | src | / | TournamentGenerator | / | Containers |
File | Role | Description |
---|---|---|
BaseContainer.php | Class | Class source |
ContainerQuery.php | Class | Class source |
GameContainer.php | Class | Class source |
HierarchyContainer.php | Class | Class source |
index.php | Aux. | Auxiliary script |
TeamContainer.php | Class | Class source |
Files | / | src | / | TournamentGenerator | / | Export |
File | Role | Description |
---|---|---|
Export.php | Class | Class source |
ExportBase.php | Class | Class source |
Exporter.php | Class | Class source |
GameExporter.php | Class | Class source |
index.php | Aux. | Auxiliary script |
SetupExporter.php | Class | Class source |
TeamExporter.php | Class | Class source |
Files | / | src | / | TournamentGenerator | / | Helpers |
File | Role | Description | ||
---|---|---|---|---|
Sorter (4 files) | ||||
Filter.php | Class | Class source | ||
FilterComparator.php | Class | Class source | ||
Functions.php | Class | Class source | ||
Generator.php | Class | Class source | ||
index.php | Aux. | Auxiliary script | ||
Simulator.php | Class | Class source |
Files | / | src | / | TournamentGenerator | / | Helpers | / | Sorter |
File | Role | Description |
---|---|---|
BaseSorter.php | Class | Class source |
GameSorter.php | Class | Class source |
index.php | Aux. | Auxiliary script |
TeamSorter.php | Class | Class source |
Files | / | src | / | TournamentGenerator | / | Interfaces |
File | Role | Description |
---|---|---|
index.php | Aux. | Auxiliary script |
WithCategories.php | Class | Class source |
WithGames.php | Class | Class source |
WithGeneratorSetters.php | Class | Class source |
WithGroups.php | Class | Class source |
WithRounds.php | Class | Class source |
WithSkipSetters.php | Class | Class source |
WithTeams.php | Class | Class source |
Files | / | src | / | TournamentGenerator | / | Preset |
File | Role | Description |
---|---|---|
DoubleElimination.php | Class | Class source |
index.php | Aux. | Auxiliary script |
Preset.php | Class | Class source |
R2G.php | Class | Class source |
SingleElimination.php | Class | Class source |
Files | / | src | / | TournamentGenerator | / | Traits |
File | Role | Description |
---|---|---|
HasPositions.php | Class | Class source |
HasScore.php | Class | Class source |
index.php | Aux. | Auxiliary script |
WithCategories.php | Class | Class source |
WithGames.php | Class | Class source |
WithGroups.php | Class | Class source |
WithRounds.php | Class | Class source |
WithSkipSetters.php | Class | Class source |
WithTeams.php | Class | Class source |
Files | / | tests |
File | Role | Description | ||
---|---|---|---|---|
Containers (3 files) | ||||
Export (4 files) | ||||
Helpers (5 files) | ||||
Hierarchy (4 files) | ||||
Presets (3 files) | ||||
Traits (1 file) | ||||
GameTest.php | Class | Class source | ||
ProgressionTest.php | Class | Class source | ||
TeamTest.php | Class | Class source |
Files | / | tests | / | Containers |
File | Role | Description |
---|---|---|
BaseContainerTest.php | Class | Class source |
GameContainerTest.php | Class | Class source |
HierarchyContainerTest.php | Class | Class source |
Files | / | tests | / | Export |
File | Role | Description |
---|---|---|
ExporterTest.php | Class | Class source |
GameExporterTest.php | Class | Class source |
SetupExporterTest.php | Class | Class source |
TeamExporterTest.php | Class | Class source |
Files | / | tests | / | Helpers |
File | Role | Description |
---|---|---|
FilterTest.php | Class | Class source |
FunctionsTest.php | Class | Class source |
GeneratorTest.php | Class | Class source |
SorterTest.php | Class | Class source |
TeamFilterTest.php | Class | Class source |
Files | / | tests | / | Hierarchy |
File | Role | Description |
---|---|---|
CategoryTest.php | Class | Class source |
GroupTest.php | Class | Class source |
RoundTest.php | Class | Class source |
TournamentTest.php | Class | Class source |
Files | / | tests | / | Presets |
File | Role | Description |
---|---|---|
DoubleEliminationTest.php | Class | Class source |
SingleEliminationTest.php | Class | Class source |
TwoRoundsTest.php | Class | Class source |
Files | / | wiki |
Files | / | wiki | / | examples |
File | Role | Description |
---|---|---|
basic.md | Data | Auxiliary data |
filters.md | Data | Auxiliary data |
preset.md | Data | Auxiliary data |
progressions.md | Data | Auxiliary data |
simulating.md | Data | Auxiliary data |
Files | / | wiki | / | template |
File | Role | Description |
---|---|---|
2R2G.md | Data | Auxiliary data |
doubleElim.md | Data | Auxiliary data |
list.md | Data | Auxiliary data |
singleElim.md | Data | Auxiliary data |
tournament-generator-2021-05-26.zip 734KB | |
tournament-generator-2021-05-26.tar.gz 476KB | |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.
Related pages |
Documentation Documentation of the whole library |