trueskill/src/PartialPlay.php

22 lines
483 B
PHP
Raw Normal View History

2022-07-05 15:55:47 +02:00
<?php
declare(strict_types=1);
2022-07-05 15:55:47 +02:00
namespace DNW\Skills;
class PartialPlay
{
2023-08-02 12:39:42 +00:00
public static function getPartialPlayPercentage(Player $player): float
{
$partialPlayPercentage = $player->getPartialPlayPercentage();
// HACK to get around bug near 0
$smallestPercentage = 0.0001;
if ($partialPlayPercentage < $smallestPercentage) {
$partialPlayPercentage = $smallestPercentage;
}
return $partialPlayPercentage;
}
2022-07-05 15:55:47 +02:00
}