mirror of
https://github.com/JeroenED/libpairtwo.git
synced 2024-11-21 22:17:41 +01:00
Merge branch 'bugfix/getParticipants' into develop
This commit is contained in:
commit
3fcdb97c63
@ -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
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user