mirror of
https://github.com/furyfire/trueskill.git
synced 2025-01-15 17:37:39 +00:00
22 lines
465 B
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;
|
|
}
|
|
}
|