Files
trueskill/src/PartialPlay.php

22 lines
423 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
{
2024-07-04 09:38:03 +00:00
$partialPlayPct = $player->getPartialPlayPercentage();
// HACK to get around bug near 0
2024-07-04 09:38:03 +00:00
$smallestPct = 0.0001;
if ($partialPlayPct < $smallestPct) {
return $smallestPct;
}
2024-07-04 09:38:03 +00:00
return $partialPlayPct;
}
2022-07-05 15:55:47 +02:00
}