| @@ 18-25 (lines=8) @@ | ||
| 15 | * |
|
| 16 | * @return Collection |
|
| 17 | */ |
|
| 18 | protected function getByeGroup($fighters) |
|
| 19 | { |
|
| 20 | $fighterCount = $fighters->count(); |
|
| 21 | $treeSize = $this->getTreeSize($fighterCount, 2); |
|
| 22 | $byeCount = $treeSize - $fighterCount; |
|
| 23 | ||
| 24 | return $this->createByeGroup($byeCount); |
|
| 25 | } |
|
| 26 | ||
| 27 | /** |
|
| 28 | * Chunk Fighters into groups for fighting, and optionnaly shuffle. |
|
| @@ 20-28 (lines=9) @@ | ||
| 17 | * |
|
| 18 | * @return Collection |
|
| 19 | */ |
|
| 20 | protected function getByeGroup($fighters) |
|
| 21 | { |
|
| 22 | $fighterCount = $fighters->count(); |
|
| 23 | $firstRoundGroupSize = $this->firstRoundGroupSize(); // Get the size of groups in the first round (2,3,4) |
|
| 24 | // Max number of fighters for the first round |
|
| 25 | $treeSize = $this->getTreeSize($fighterCount, $firstRoundGroupSize); |
|
| 26 | $byeCount = $treeSize - $fighterCount; |
|
| 27 | return $this->createByeGroup($byeCount); |
|
| 28 | } |
|
| 29 | ||
| 30 | /** |
|
| 31 | * Save Groups with their parent info. |
|