Moved points tiebreak to return Player::getPoints()

This commit is contained in:
Jeroen De Meerleer 2019-05-30 21:02:31 +02:00
parent 9bf31b7ec5
commit 4672c91298
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6

View File

@ -36,15 +36,7 @@ abstract class Tiebreaks extends Tournament
*/ */
protected function calculatePoints(Player $player): ?float protected function calculatePoints(Player $player): ?float
{ {
$points = 0; return $player->getPoints();
foreach ($player->getPairings() as $pairing) {
if (array_search($pairing->getResult(), Constants::Won) !== false) {
$points = $points + 1;
} elseif (array_search($pairing->getResult(), Constants::Draw) !== false) {
$points = $points + 0.5;
}
}
return $points;
} }