mirror of
https://github.com/furyfire/trueskill.git
synced 2026-03-12 17:49:10 +01:00
Bit foies for static code analysis.
This commit is contained in:
@@ -8,11 +8,11 @@ use DNW\Skills\Numerics\GaussianDistribution;
|
||||
|
||||
class Variable
|
||||
{
|
||||
private mixed $value;
|
||||
private GaussianDistribution $value;
|
||||
|
||||
public function __construct(private readonly GaussianDistribution $prior)
|
||||
{
|
||||
$this->resetToPrior();
|
||||
$this->value = $prior;
|
||||
}
|
||||
|
||||
public function getValue(): GaussianDistribution
|
||||
|
||||
@@ -29,9 +29,6 @@ final class FactorGraphTrueSkillCalculator extends SkillCalculator
|
||||
parent::__construct(SkillCalculator::PARTIAL_PLAY | SkillCalculator::PARTIAL_UPDATE, TeamsRange::atLeast(2), PlayersRange::atLeast(1));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function calculateNewRatings(
|
||||
GameInfo $gameInfo,
|
||||
@@ -52,9 +49,6 @@ final class FactorGraphTrueSkillCalculator extends SkillCalculator
|
||||
return $factorGraph->getUpdatedRatings();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function calculateMatchQuality(GameInfo $gameInfo, array $teams): float
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||
namespace DNW\Skills\TrueSkill;
|
||||
|
||||
use DNW\Skills\GameInfo;
|
||||
use DNW\Skills\Guard;
|
||||
use DNW\Skills\Team;
|
||||
use DNW\Skills\Numerics\BasicMath;
|
||||
use DNW\Skills\PairwiseComparison;
|
||||
use DNW\Skills\PlayersRange;
|
||||
@@ -28,9 +28,6 @@ final class TwoPlayerTrueSkillCalculator extends SkillCalculator
|
||||
parent::__construct(SkillCalculator::NONE, TeamsRange::exactly(2), PlayersRange::exactly(1));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function calculateNewRatings(GameInfo $gameInfo, array $teams, array $teamRanks): RatingContainer
|
||||
{
|
||||
@@ -39,7 +36,9 @@ final class TwoPlayerTrueSkillCalculator extends SkillCalculator
|
||||
|
||||
// Make sure things are in order
|
||||
RankSorter::sort($teams, $teamRanks);
|
||||
|
||||
/**
|
||||
* @var Team[] $teams
|
||||
*/
|
||||
// Since we verified that each team has one player, we know the player is the first one
|
||||
$winningTeamPlayers = $teams[0]->getAllPlayers();
|
||||
$winner = $winningTeamPlayers[0];
|
||||
@@ -132,9 +131,6 @@ final class TwoPlayerTrueSkillCalculator extends SkillCalculator
|
||||
return new Rating($newMean, $newStdDev);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function calculateMatchQuality(GameInfo $gameInfo, array $teams): float
|
||||
{
|
||||
|
||||
@@ -28,9 +28,6 @@ final class TwoTeamTrueSkillCalculator extends SkillCalculator
|
||||
parent::__construct(SkillCalculator::NONE, TeamsRange::exactly(2), PlayersRange::atLeast(1));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function calculateNewRatings(GameInfo $gameInfo, array $teams, array $teamRanks): RatingContainer
|
||||
{
|
||||
@@ -38,6 +35,9 @@ final class TwoTeamTrueSkillCalculator extends SkillCalculator
|
||||
|
||||
RankSorter::sort($teams, $teamRanks);
|
||||
|
||||
/**
|
||||
* @var Team[] $teams
|
||||
*/
|
||||
$team1 = $teams[0];
|
||||
$team2 = $teams[1];
|
||||
|
||||
@@ -138,9 +138,6 @@ final class TwoTeamTrueSkillCalculator extends SkillCalculator
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
#[\Override]
|
||||
public function calculateMatchQuality(GameInfo $gameInfo, array $teams): float
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user