mirror of
https://github.com/JeroenED/libpairtwo.git
synced 2024-11-22 06:26:57 +01:00
fixed koya
This commit is contained in:
parent
79cf105c98
commit
025a45f5bb
@ -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();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user