From a10b0dd9de5c0e72d3cc732f9f4dada0fe539317 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Mon, 3 Jun 2019 12:07:20 +0200 Subject: [PATCH 1/2] deleted getting started.md moved to https://github.com/JeroenED/libpairtwo/wiki/1.-Getting-Started --- doc/.gitkeep | 0 doc/0. Getting started.md | 69 --------------------------------------- 2 files changed, 69 deletions(-) create mode 100644 doc/.gitkeep delete mode 100644 doc/0. Getting started.md diff --git a/doc/.gitkeep b/doc/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/doc/0. Getting started.md b/doc/0. Getting started.md deleted file mode 100644 index 2e19184..0000000 --- a/doc/0. Getting started.md +++ /dev/null @@ -1,69 +0,0 @@ -# Getting started - -## Installing Libpairtwo -You can easily start using libpairtwo by installing it via composer - -```bash -$ composer install JeroenED/libpairtwo -``` - -In you initialization code add the vendor/autoload.php -```php -require_once("vendor/autoload.php"); -``` - -## Reading out a sws-file -Reading out a sws-file is very simple. Just call the Sws::ReadSws() method. - -```php -$sws = JeroenED\Libpairtwo\Sws::ReadSws("Clubcompetition.sws"); -``` -This will return a usable object for reaching out for results, rankings, etc. - -## Getting methods of the class -I didn't want to add the generated phpdoc in this library simply because it is generated. - -The command to generate it yourself is just `$ phpdoc`. This will generate the docs in the doc/api folder. - -## Examples - -### Getting results of a tournament -```php -getTournament(); -$calendar = $tournament->getRounds(); -$roundNo = 1; -foreach ($calendar as $round) { - echo "Ronde: " . $roundNo . ' (' . $round->getDate()->format('Y/m/d') . PHP_EOL . ')'; $roundNo++; - foreach($round->getGames() as $game) { - if (!is_null($game->getResult())) { - echo (is_null($game->getWhite())) ? "bye" : $game->getWhite()->getPlayer()->getName(); - echo " " . $game->getResult()->getValue() . " "; - echo (is_null($game->getBlack())) ? "bye" : $game->getBlack()->getPlayer()->getName(); - echo PHP_EOL; - } - } - echo PHP_EOL; -``` - -### Getting rankings of the tournament -```php -getTournament(); -$rankings = $tournament->getRanking(); -$rankingNo = 1; -foreach ($rankings as $ranking) { - echo $rankingNo . '. ' . $ranking->getTitle()->getKey() . ' ' . $ranking->getName() . '(' . $ranking->getPoints() . '/' . $tournament->getNoOfRounds() . ')' . PHP_EOL; -} -echo PHP_EOL; -``` From b9a17e39a2c2f24b20dfb929d0dd389a3d79f6a2 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Mon, 3 Jun 2019 12:21:52 +0200 Subject: [PATCH 2/2] Updated readme --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1c35437..08f6ee9 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,14 @@ -# Lib Pairtwo +# libpairtwo Copyright 2018- (c) Jeroen De Meerleer -This library reads sws-files that are saved using PairTwo developed by the Belgian Chess Federation (KBSB-FRBE). +This library reads out pairing files that are saved using common pairing applications ## Special thanks * Daniel Halleux (Webmaster KBSB) * Bernard Malfliet (Original developer Pairtwo) +* Sylvin De Vet (Arbiter at VSF championship 2019 who helped me explaining several tiebreaks and other arbiter related stuff) ## Licence