BUGFIX: Tournament::getParticipants() did not return a correct value

This commit is contained in:
Jeroen De Meerleer 2019-06-18 16:01:15 +02:00
parent f6435320fd
commit 663951a9cc
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
4 changed files with 11 additions and 22 deletions

View File

@ -5,6 +5,7 @@
* NEW FEATURE: Soccer Kashdan (aka: kashdan using 3-1-0 scoring)
* CHANGE: Deprecated `sws::class` was removed
* CHANGE: Added a logo to the project
* BUGFIX: `Tournament::getParticipants()` did not return a correct value
## v1.0.2 (Released: 05-jun-2019)
* NEW FEATURE: `Player::getPlayedGames()` to return the number of played games

View File

@ -74,9 +74,6 @@ abstract class Tournament
/** @var Round[] */
private $Rounds = [];
/** @var int */
private $Participants;
/** @var string */
private $Tempo;
@ -329,24 +326,6 @@ abstract class Tournament
return $this;
}
/**
* @return int
*/
public function getParticipants(): int
{
return $this->Participants;
}
/**
* @param int $Participants
* @return Tournament
*/
public function setParticipants(int $Participants): Tournament
{
$this->Participants = $Participants;
return $this;
}
/**
* @return string
*/

View File

@ -507,7 +507,7 @@ class Pairtwo6 extends Pairtwo6Model implements ReaderInterface
// Participants
$length = 4;
$this->getTournament()->setParticipants($this->readData('Int', substr($swscontents, $offset, $length)));
$this->getTournament()->setBinaryData('Participants', $this->readData('Int', substr($swscontents, $offset, $length)));
$offset += $length;
// Fidehomol

View File

@ -351,4 +351,13 @@ class Tournament extends Tiebreaks
}
return intdiv($totalrating, $players);
}
/**
* Returns the number of participants
*
* @return int
*/
public function getParticipants(): int {
return count($this->getPlayers());
}
}