More types

This commit is contained in:
2023-08-02 10:59:15 +00:00
parent 5c7471963c
commit 72de6363fe
6 changed files with 16 additions and 9 deletions

View File

@ -39,12 +39,12 @@ abstract class SkillCalculator
*/
abstract public function calculateMatchQuality(GameInfo $gameInfo, array $teamsOfPlayerToRatings): float;
public function isSupported($option): bool
public function isSupported(SkillCalculatorSupportedOptions $option): bool
{
return ($this->supportedOptions & $option) == $option;
return (bool)($this->supportedOptions & $option->value) == $option;
}
protected function validateTeamCountAndPlayersCountPerTeam(array $teamsOfPlayerToRatings)
protected function validateTeamCountAndPlayersCountPerTeam(array $teamsOfPlayerToRatings): void
{
self::validateTeamCountAndPlayersCountPerTeamWithRanges($teamsOfPlayerToRatings, $this->totalTeamsAllowed, $this->playersPerTeamAllowed);
}