mirror of
https://github.com/JeroenED/libpairtwo.git
synced 2024-11-24 23:37:41 +01:00
Added posibility to add multiple arbiters
This commit is contained in:
parent
89627cd369
commit
34a9e43da9
@ -57,8 +57,8 @@ class Tournament
|
||||
/** @var DateTime */
|
||||
private $EndDate;
|
||||
|
||||
/** @var string */
|
||||
private $Arbiter;
|
||||
/** @var string[] */
|
||||
private $Arbiters;
|
||||
|
||||
/** @var int */
|
||||
private $NoOfRounds;
|
||||
@ -198,6 +198,21 @@ class Tournament
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adds an arbiter to the tournament
|
||||
*
|
||||
* @param string $Arbiter
|
||||
* @return Tournament
|
||||
*/
|
||||
public function addArbiter(string $Arbiter): Tournament
|
||||
{
|
||||
$newArray = $this->getArbiters();
|
||||
$newArray[] = $Arbiter;
|
||||
$this->setArbiters($newArray);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts pairings into games with a black and white player
|
||||
*
|
||||
@ -999,20 +1014,42 @@ class Tournament
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getArbiter(): string
|
||||
public function getArbiter(int $order = 0): string
|
||||
{
|
||||
return $this->Arbiter;
|
||||
return $this->Arbiters[$order];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the arbiters of the tournament
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getArbiters(): array
|
||||
{
|
||||
return $this->Arbiters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the arbiter of the tournament
|
||||
*
|
||||
* @param string $Arbiter
|
||||
* @param string[] $Arbiter
|
||||
* @return Tournament
|
||||
*/
|
||||
public function setArbiter(string $Arbiter): Tournament
|
||||
public function setArbiter(string $Arbiter, int $order = 0): Tournament
|
||||
{
|
||||
$this->Arbiter = $Arbiter;
|
||||
$this->Arbiters[$order] = $Arbiter;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the arbiters of the tournament
|
||||
*
|
||||
* @param string[] $Arbiters
|
||||
* @return Tournament
|
||||
*/
|
||||
public function setArbiters(array $Arbiters): Tournament
|
||||
{
|
||||
$this->Arbiters = $Arbiters;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user