mirror of
https://github.com/JeroenED/libpairtwo.git
synced 2024-11-22 14:36:57 +01:00
46 lines
1.2 KiB
PHP
46 lines
1.2 KiB
PHP
|
<?php
|
||
|
|
||
|
|
||
|
namespace JeroenED\Libpairtwo;
|
||
|
|
||
|
use JeroenED\Libpairtwo\Models\Tournament;
|
||
|
|
||
|
abstract class Tiebreaks extends Tournament
|
||
|
{
|
||
|
/**
|
||
|
* @param int $key
|
||
|
*/
|
||
|
protected function calculateKeizer(int $key)
|
||
|
{
|
||
|
foreach ($this->getPlayers() as $player) {
|
||
|
$currentTiebreaks = $player->getTiebreaks();
|
||
|
$currentTiebreaks[$key] = $player->getBinaryData('ScoreAmerican');
|
||
|
$player->setTiebreaks($currentTiebreaks);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @param int $key
|
||
|
*/
|
||
|
protected function calculateAmerican(int $key)
|
||
|
{
|
||
|
foreach ($this->getPlayers() as $player) {
|
||
|
$currentTiebreaks = $player->getTiebreaks();
|
||
|
$currentTiebreaks[$key] = $player->getBinaryData('ScoreAmerican');
|
||
|
$player->setTiebreaks($currentTiebreaks);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @param int $key
|
||
|
*/
|
||
|
protected function calculatePoints(int $key)
|
||
|
{
|
||
|
foreach ($this->getPlayers() as $player) {
|
||
|
$currentTiebreaks = $player->getTiebreaks();
|
||
|
$currentTiebreaks[$key] = $player->getBinaryData('Points');
|
||
|
$player->setTiebreaks($currentTiebreaks);
|
||
|
}
|
||
|
}
|
||
|
}
|