mirror of
https://github.com/JeroenED/libpairtwo.git
synced 2024-12-22 04:11:22 +01:00
Add points as very first tiebreak
This commit is contained in:
parent
3ea12b0377
commit
627e9a4263
@ -477,6 +477,7 @@ class Swar4 implements ReaderInterface
|
||||
}
|
||||
fclose($swshandle);
|
||||
$this->getTournament()->pairingsToRounds();
|
||||
$this->addTiebreaks();
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -619,4 +620,24 @@ class Swar4 implements ReaderInterface
|
||||
return DateTime::createFromFormat('Ymd', $string);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
private function addTiebreaks(): Swar4
|
||||
{
|
||||
switch ($this->getTournament()->getSystem()) {
|
||||
case TournamentSystem::American:
|
||||
$firstElement = new Tiebreak(Tiebreak::American);
|
||||
break;
|
||||
case TournamentSystem::Closed:
|
||||
case TournamentSystem::Swiss:
|
||||
default:
|
||||
$firstElement = new Tiebreak(Tiebreak::Points);
|
||||
}
|
||||
$tiebreaks = $this->getTournament()->getTiebreaks();
|
||||
array_unshift($tiebreaks, $firstElement);
|
||||
$this->getTournament()->setTiebreaks($tiebreaks);
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user