mirror of
https://github.com/JeroenED/libpairtwo.git
synced 2024-11-25 07:47:42 +01:00
Merge branch 'bugfix/cumulativefix' into develop
This commit is contained in:
commit
5da506b743
@ -279,6 +279,7 @@ abstract class Tiebreaks extends Tournament
|
|||||||
protected function calculateCumulative(Player $player): ?float
|
protected function calculateCumulative(Player $player): ?float
|
||||||
{
|
{
|
||||||
$tiebreak = 0;
|
$tiebreak = 0;
|
||||||
|
$score = [];
|
||||||
foreach ($player->getPairings() as $pairing) {
|
foreach ($player->getPairings() as $pairing) {
|
||||||
$toadd = 0;
|
$toadd = 0;
|
||||||
if (array_search($pairing->getResult(), Constants::Won) !== false) {
|
if (array_search($pairing->getResult(), Constants::Won) !== false) {
|
||||||
@ -286,8 +287,9 @@ abstract class Tiebreaks extends Tournament
|
|||||||
} elseif (array_search($pairing->getResult(), Constants::Draw) !== false) {
|
} elseif (array_search($pairing->getResult(), Constants::Draw) !== false) {
|
||||||
$toadd = 0.5;
|
$toadd = 0.5;
|
||||||
}
|
}
|
||||||
$tiebreak += $tiebreak + $toadd;
|
$tiebreak += $toadd;
|
||||||
|
$score[] = $tiebreak;
|
||||||
}
|
}
|
||||||
return $tiebreak;
|
return array_sum($score);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user