fixed koya

This commit is contained in:
Jeroen De Meerleer 2019-06-01 15:25:01 +02:00
parent 79cf105c98
commit 025a45f5bb
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6

View File

@ -178,8 +178,12 @@ abstract class Tiebreaks extends Tournament
{ {
$tiebreak = 0; $tiebreak = 0;
foreach ($player->getPairings() as $plkey => $plpairing) { foreach ($player->getPairings() as $plkey => $plpairing) {
if (($plpairing->getOpponent()->getNoOfWins() / count($plpairing->getOpponent()->getPairings()) * 100) >= $cut) { if (($plpairing->getOpponent()->getPoints() / count($plpairing->getOpponent()->getPairings()) * 100) >= $cut) {
$tiebreak += $plpairing->getOpponent()->getNoOfWins(); if (array_search($plpairing->getResult(), Constants::Won) !== false) {
$tiebreak += 1;
} elseif (array_search($plpairing->getResult(), Constants::Draw) !== false) {
$tiebreak += 0.5;
}
} }
} }
return $tiebreak; return $tiebreak;
@ -214,8 +218,7 @@ abstract class Tiebreaks extends Tournament
$intpairings = array_slice($intpairings, $cutlowest); $intpairings = array_slice($intpairings, $cutlowest);
$intpairings = array_slice($intpairings, 0, 0 - $cuthighest); $intpairings = array_slice($intpairings, 0, 0 - $cuthighest);
foreach ($intpairings as $intkey => $intpairing) { foreach ($intpairings as $intkey => $intpairing) {
echo $tiebreak . PHP_EOL;
if (!is_null($intpairing->getOpponent())) { if (!is_null($intpairing->getOpponent())) {
$tiebreak += $intpairing->getOpponent()->getPoints(); $tiebreak += $intpairing->getOpponent()->getPoints();
} }