diff --git a/dist/template.php b/dist/template.php index aced29e..4ae1cb2 100644 --- a/dist/template.php +++ b/dist/template.php @@ -2,7 +2,7 @@ // EDIT ME! $pairingfile = 'your pairing-file.swar'; -$fileformat = 'Swar-4'; // Possible values: Pairtwo-5, Pairtwo-6, Swar-4 +$fileformat = 'Swar-4'; // Possible getValue()s: Pairtwo-5, Pairtwo-6, Swar-4 ?> @@ -37,37 +37,37 @@ $reader->read($pairingfile); // You can also use the doc/api folder to get all possible methods and fields // Below is an example of what can be used. Feel free to modify this. -echo '

' . $reader->getTournament()->getName() . '

' . PHP_EOL; -foreach ($reader->getTournament()->getRounds() as $round) { - echo '

Round ' . ($round->getRoundNo() + 1) . ': ' . $round->getDate()->format('m/d/Y') . '

' . PHP_EOL; +echo '

' . $reader->Tournament->Name . '

' . PHP_EOL; +foreach ($reader->Tournament->Rounds as $round) { + echo '

Round ' . ($round->RoundNo + 1) . ': ' . $round->Date->format('m/d/Y') . '

' . PHP_EOL; echo '' . PHP_EOL; echo '' . PHP_EOL; echo '' . PHP_EOL; echo '' . PHP_EOL; echo '' . PHP_EOL; - foreach ($round->getGamesByBoard() as $game) { + foreach ($round->GamesByBoard as $game) { echo '' . PHP_EOL; - echo '' . PHP_EOL; - echo '' . PHP_EOL; - echo '' . PHP_EOL; - echo '' . PHP_EOL; + echo '' . PHP_EOL; + echo '' . PHP_EOL; + echo '' . PHP_EOL; + echo '' . PHP_EOL; echo '' . PHP_EOL; } echo '' . PHP_EOL; echo '
WhiteBlackResult
' . ($game->getBoard() + 1) . '' . $game->getWhite()->getPlayer()->getName() . '' . $game->getBlack()->getPlayer()->getName() . '' . $game->getResult()->getValue() . '' . ($game->Board + 1) . '' . $game->White->Player->Name . '' . $game->Black->Player->Name . '' . $game->Result->getValue() . '
' . PHP_EOL; echo '

Bye: '; $bye = []; - foreach ($round->getBye() as $pairing) { - $bye[] = $pairing->getPlayer()->getName(); + foreach ($round->Bye as $pairing) { + $bye[] = $pairing->Player->Name; } echo implode('; ', $bye); echo '

' . PHP_EOL; echo '

Absent: '; $bye = []; - foreach ($round->getAbsent() as $pairing) { - $bye[] = $pairing->getPlayer()->getName(); + foreach ($round->Absent as $pairing) { + $bye[] = $pairing->Player->Name; } echo implode('; ', $bye); echo '

' . PHP_EOL; @@ -77,7 +77,7 @@ echo '

Rankings

' . PHP_EOL; echo '' . PHP_EOL; echo '' . PHP_EOL; echo '' . PHP_EOL; -foreach ($reader->getTournament()->getTieBreaks() as $tiebreak) { +foreach ($reader->Tournament->TieBreaks as $tiebreak) { echo '' . PHP_EOL; } echo '' . PHP_EOL; @@ -85,11 +85,11 @@ echo '' . PHP_EOL; echo '' . PHP_EOL; $rank = 1; -foreach ($reader->getTournament()->getRanking() as $player) { +foreach ($reader->Tournament->Ranking as $player) { echo '' . PHP_EOL; echo '' . PHP_EOL; - echo '' . PHP_EOL; - echo '' . PHP_EOL; + echo '' . PHP_EOL; + echo '' . PHP_EOL; echo '' . PHP_EOL; $rank++; }
Name (elo)' . $tiebreak->getValue() . '
' . $rank . '' . $player->getName() . '(' . $player->getElo($reader->getTournament()->getPriorityElo()) . ')' . implode('', $player->getTiebreaks()) . '' . $player->Name . '(' . $player->getElo($reader->Tournament->PriorityElo) . ')' . implode('', $player->Tiebreaks) . '