mirror of
https://github.com/JeroenED/libpairtwo.git
synced 2024-11-23 15:06:57 +01:00
Created e. Reader boilerplate (markdown)
parent
5a97033010
commit
ba67f711bb
43
e.-Reader-boilerplate.md
Normal file
43
e.-Reader-boilerplate.md
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
```php
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use JeroenED\Libpairtwo\Enums\Color;
|
||||||
|
use JeroenED\Libpairtwo\Enums\Result;
|
||||||
|
use JeroenED\Libpairtwo\Enums\Tiebreak;
|
||||||
|
use JeroenED\Libpairtwo\Enums\TournamentSystem;
|
||||||
|
use JeroenED\Libpairtwo\Interfaces\ReaderInterface;
|
||||||
|
use JeroenED\Libpairtwo\Pairing;
|
||||||
|
use JeroenED\Libpairtwo\Round;
|
||||||
|
use JeroenED\Libpairtwo\Tournament;
|
||||||
|
use JeroenED\Libpairtwo\Player;
|
||||||
|
|
||||||
|
class CompetitieReader implements ReaderInterface
|
||||||
|
{
|
||||||
|
/** @var Tournament */
|
||||||
|
private $Tournament;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Tournament
|
||||||
|
*/
|
||||||
|
public function getTournament(): Tournament
|
||||||
|
{
|
||||||
|
return $this->Tournament;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Tournament $Tournament
|
||||||
|
*/
|
||||||
|
public function setTournament(Tournament $Tournament)
|
||||||
|
{
|
||||||
|
$this->Tournament = $Tournament;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function read($filename): ReaderInterface
|
||||||
|
{
|
||||||
|
$tournament = new Tournament();
|
||||||
|
// Reading out of fields
|
||||||
|
$this->setTournament($tournament);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
Loading…
Reference in New Issue
Block a user