mirror of
https://github.com/JeroenED/libpairtwo.git
synced 2024-11-16 03:47:50 +01:00
Updated Showing the pairings of a specific round (markdown)
parent
dc76d0fbc8
commit
721cb1f742
@ -16,12 +16,13 @@ use JeroenED\Libpairtwo\Enums\Result;
|
|||||||
$sws = Sws::readSws('mycompetition.sws');
|
$sws = Sws::readSws('mycompetition.sws');
|
||||||
$tournament = $sws->getTournament();
|
$tournament = $sws->getTournament();
|
||||||
$pairings = $tournament->getRoundByNo($_GET['round'])->getPairings();
|
$pairings = $tournament->getRoundByNo($_GET['round'])->getPairings();
|
||||||
|
|
||||||
foreach($pairings as $pairing) {
|
foreach($pairings as $pairing) {
|
||||||
$player = $pairing->getPlayer()->getName();
|
$player = $pairing->getPlayer()->getName();
|
||||||
if (!is_null($pairing->getOpponent())) {
|
if (!is_null($pairing->getOpponent())) {
|
||||||
$opponent = $pairing->getOpponent()->getName();
|
$opponent = $pairing->getOpponent()->getName();
|
||||||
$color = $pairing->getColor()->getKey();
|
$color = $pairing->getColor()->getKey();
|
||||||
echo $player . ' against ' . $opponent . ' using ' . $color . PHP_EOL;
|
echo $player . ' ' . $pairing->getResult()->getKey() . ' against ' . $opponent . ' using ' . $color . PHP_EOL;
|
||||||
} elseif ($pairing->getResult() == Result::bye) {
|
} elseif ($pairing->getResult() == Result::bye) {
|
||||||
echo $player . ' is bye' . PHP_EOL;
|
echo $player . ' is bye' . PHP_EOL;
|
||||||
} elseif ($pairing->getResult() == Result::absent) {
|
} elseif ($pairing->getResult() == Result::absent) {
|
||||||
|
Loading…
Reference in New Issue
Block a user