mirror of
https://github.com/furyfire/trueskill.git
synced 2025-07-15 07:50:58 +02:00
22 lines
429 B
PHP
22 lines
429 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace DNW\Skills;
|
|
|
|
final class PartialPlay
|
|
{
|
|
public static function getPartialPlayPercentage(Player $player): float
|
|
{
|
|
$partialPlayPct = $player->getPartialPlayPercentage();
|
|
|
|
// HACK to get around bug near 0
|
|
$smallestPct = 0.0001;
|
|
if ($partialPlayPct < $smallestPct) {
|
|
return $smallestPct;
|
|
}
|
|
|
|
return $partialPlayPct;
|
|
}
|
|
}
|