mirror of
https://github.com/JeroenED/libpairtwo.git
synced 2024-11-22 06:26:57 +01:00
Reimplemented getParticipants
Possibly historic field that became unused
This commit is contained in:
parent
fcd6766cfe
commit
1f3e381049
@ -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