trueskill/src/PartialPlay.php

22 lines
465 B
PHP

<?php
declare(strict_types=1);
namespace DNW\Skills;
class PartialPlay
{
public static function getPartialPlayPercentage(Player $player): float
{
$partialPlayPercentage = $player->getPartialPlayPercentage();
// HACK to get around bug near 0
$smallestPercentage = 0.0001;
if ($partialPlayPercentage < $smallestPercentage) {
return $smallestPercentage;
}
return $partialPlayPercentage;
}
}