| @@ 37-50 (lines=14) @@ | ||
| 34 | * @param integer $numRounds |
|
| 35 | * @param $numFightersElim |
|
| 36 | */ |
|
| 37 | protected function pushGroups($numRounds, $numFightersElim) |
|
| 38 | { |
|
| 39 | // TODO Here is where you should change when enable several winners for preliminary |
|
| 40 | for ($roundNumber = 2; $roundNumber <= $numRounds + 1; $roundNumber++) { |
|
| 41 | // From last match to first match |
|
| 42 | $maxMatches = ($numFightersElim / pow(2, $roundNumber)); |
|
| 43 | ||
| 44 | for ($matchNumber = 1; $matchNumber <= $maxMatches; $matchNumber++) { |
|
| 45 | $fighters = $this->createByeGroup(2); |
|
| 46 | $group = $this->saveGroup(1, $matchNumber, $roundNumber, null); |
|
| 47 | $this->syncGroup($group, $fighters); |
|
| 48 | } |
|
| 49 | } |
|
| 50 | } |
|
| 51 | ||
| 52 | /** |
|
| 53 | * Create empty groups for direct Elimination Tree |
|
| @@ 72-84 (lines=13) @@ | ||
| 69 | * @param integer $numRounds |
|
| 70 | * @param $numFightersElim |
|
| 71 | */ |
|
| 72 | protected function pushGroups($numRounds, $numFightersElim) |
|
| 73 | { |
|
| 74 | for ($roundNumber = 2; $roundNumber <= $numRounds; $roundNumber++) { |
|
| 75 | // From last match to first match |
|
| 76 | $maxMatches = ($numFightersElim / pow(2, $roundNumber)); |
|
| 77 | ||
| 78 | for ($matchNumber = 1; $matchNumber <= $maxMatches; $matchNumber++) { |
|
| 79 | $fighters = $this->createByeGroup(2); |
|
| 80 | $group = $this->saveGroup(1, $matchNumber, $roundNumber, null); |
|
| 81 | $this->syncGroup($group, $fighters); |
|
| 82 | } |
|
| 83 | } |
|
| 84 | } |
|
| 85 | ||
| 86 | /** |
|
| 87 | * Return number of rounds for the tree based on fighter count |
|