mirror of
https://github.com/JeroenED/libpairtwo.git
synced 2024-11-25 07:47:42 +01:00
BUGFIX: Tournament::getParticipants() did not return a correct value
This commit is contained in:
parent
f6435320fd
commit
663951a9cc
@ -5,6 +5,7 @@
|
|||||||
* NEW FEATURE: Soccer Kashdan (aka: kashdan using 3-1-0 scoring)
|
* NEW FEATURE: Soccer Kashdan (aka: kashdan using 3-1-0 scoring)
|
||||||
* CHANGE: Deprecated `sws::class` was removed
|
* CHANGE: Deprecated `sws::class` was removed
|
||||||
* CHANGE: Added a logo to the project
|
* CHANGE: Added a logo to the project
|
||||||
|
* BUGFIX: `Tournament::getParticipants()` did not return a correct value
|
||||||
|
|
||||||
## v1.0.2 (Released: 05-jun-2019)
|
## v1.0.2 (Released: 05-jun-2019)
|
||||||
* NEW FEATURE: `Player::getPlayedGames()` to return the number of played games
|
* NEW FEATURE: `Player::getPlayedGames()` to return the number of played games
|
||||||
|
@ -74,9 +74,6 @@ abstract class Tournament
|
|||||||
/** @var Round[] */
|
/** @var Round[] */
|
||||||
private $Rounds = [];
|
private $Rounds = [];
|
||||||
|
|
||||||
/** @var int */
|
|
||||||
private $Participants;
|
|
||||||
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
private $Tempo;
|
private $Tempo;
|
||||||
|
|
||||||
@ -329,24 +326,6 @@ abstract class Tournament
|
|||||||
return $this;
|
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
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
@ -507,7 +507,7 @@ class Pairtwo6 extends Pairtwo6Model implements ReaderInterface
|
|||||||
|
|
||||||
// Participants
|
// Participants
|
||||||
$length = 4;
|
$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;
|
$offset += $length;
|
||||||
|
|
||||||
// Fidehomol
|
// Fidehomol
|
||||||
|
@ -351,4 +351,13 @@ class Tournament extends Tiebreaks
|
|||||||
}
|
}
|
||||||
return intdiv($totalrating, $players);
|
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