matchtime/season-generator
最新稳定版本:v1.0.2
Composer 安装命令:
composer require matchtime/season-generator
包简介
A league-season match generator, installable as a package and as used on https://matchtime.uk
README 文档
README
A league-season match generator, installable as a package and as used on MatchTime.uk
Installation
To install the package add the require to your composer.json
require: {
"matchtime/season-generator": "dev-master"
}
Then do a composer install.
Usage
To use this package ....
- use the namespace in your class
MatchTime\SeasonGenerator\Generator - $generator = new Generator($options);
- $generator->generateSeason();
Options
Options must be passed to enable the generator to create the matches.
Required Options: 'first_match', 'teams',
Here is an example options array
$options = [
'first_match' => '2015-05-06',
'teams' => [1, 2, 6, 7, 9, 12],
'games_per_team' => 2,
'gap_every' => 0,
'gap_duration' => 1,
'team_conflicts' => [[1,2]]
];
FAQ
Q: How are the matches generated.
A: Please feel free to check the code, but essentially, each team is divided into home/away (which is swapped after each week). Teams matchup's are added to the seasons teams_played array to prevent same teams playing twice in each half-season.
统计信息
- 总下载量: 469
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2015-05-05