Added changes to getRanking

Jeroen De Meerleer 2019-05-28 19:11:54 +02:00
parent cfa027be7a
commit 0a15050827

@ -1,7 +1,7 @@
Currently the project is in the phase of transforming from pairtwo-only to a generalized view for multiple programs. Currently the project is in the phase of transforming from pairtwo-only to a generalized view for multiple programs.
This makes it relatively easy to add other filetypes. However, this process requires rewriting and renaming some functions. This document is dedicated to these adjustments. This makes it relatively easy to add other filetypes. However, this process requires rewriting and renaming some functions. This document is dedicated to these adjustments.
## `Sws::readSws` renamed to `ReaderInterface::read` ## `Sws::readSws` renamed to `ReaderInterface::read` `Master`
When you want to read a file, all you need to do is to create an instance of the ReaderInterface and call its read function. This procedure will be the same for any filetype in the library. When you want to read a file, all you need to do is to create an instance of the ReaderInterface and call its read function. This procedure will be the same for any filetype in the library.
@ -19,9 +19,15 @@ require_once 'vendor/autoload.php';
$reader = IOFactory::createReader('Pairtwo-6'); $reader = IOFactory::createReader('Pairtwo-6');
$sws = $reader->read('<filename>'); $sws = $reader->read('<filename>');
``` ```
## Getting a ranking `Develop`
With the generalization, work has been put in fixing the tiebreaks. This also includes that the `Tournament::GetRanking()` method has changed. Most important is that it does not have a parameter for american sort anymore.
## Changed getters and setters When you try to get a ranking and want to display a certain tiebreak, all you need to do is to call the `Player::GetTiebreaks()` function. This will return an array of applied tiebreaks. If a tiebreak was not needed, it does not get calculated and will not exist in the array.
## Getters
Currently not all and enough tiebreaks are implemented. Therefore this change is currently only available in `Develop`
## Changed getters and setters `Develop`
### Getters
| Property | Old code | New Code (getter) | Current Status | | Property | Old code | New Code (getter) | Current Status |
|------------------------------|-------------------------------------------------|------------------------------------------|----------------| |------------------------------|-------------------------------------------------|------------------------------------------|----------------|
@ -48,7 +54,7 @@ $sws = $reader->read('<filename>');
| Sws::Players($i)_Namepos | `Sws::getBinaryData('Players($i)_Namepos')` | `Player::getBinaryData('NamePos')` | Final | | Sws::Players($i)_Namepos | `Sws::getBinaryData('Players($i)_Namepos')` | `Player::getBinaryData('NamePos')` | Final |
| Sws::Players($i)_TieMatch | `Sws::getBinaryData('Players($i)_TieMatch')` | `Player::getBinaryData('Tiematch')` | Final | | Sws::Players($i)_TieMatch | `Sws::getBinaryData('Players($i)_TieMatch')` | `Player::getBinaryData('Tiematch')` | Final |
## Setters ### Setters
| Property | Old code | New Code (setter) | Current Status | | Property | Old code | New Code (setter) | Current Status |
|------------------------------|-----------------------------------------------------------------|--------------------------------------------------|----------------| |------------------------------|-----------------------------------------------------------------|--------------------------------------------------|----------------|