2022-07-05 15:55:47 +02:00
|
|
|
<?php
|
|
|
|
|
2024-02-02 15:16:11 +00:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2022-07-05 15:55:47 +02:00
|
|
|
namespace DNW\Skills;
|
2010-09-18 21:19:51 -04:00
|
|
|
|
2025-04-15 08:14:08 +00:00
|
|
|
final class PartialPlay
|
2010-09-18 21:19:51 -04:00
|
|
|
{
|
2023-08-02 12:39:42 +00:00
|
|
|
public static function getPartialPlayPercentage(Player $player): float
|
2010-09-18 21:19:51 -04:00
|
|
|
{
|
2024-07-04 09:38:03 +00:00
|
|
|
$partialPlayPct = $player->getPartialPlayPercentage();
|
2010-09-18 21:19:51 -04:00
|
|
|
|
|
|
|
// HACK to get around bug near 0
|
2024-07-04 09:38:03 +00:00
|
|
|
$smallestPct = 0.0001;
|
|
|
|
if ($partialPlayPct < $smallestPct) {
|
|
|
|
return $smallestPct;
|
2010-09-18 21:19:51 -04:00
|
|
|
}
|
|
|
|
|
2024-07-04 09:38:03 +00:00
|
|
|
return $partialPlayPct;
|
2010-09-18 21:19:51 -04:00
|
|
|
}
|
2022-07-05 15:55:47 +02:00
|
|
|
}
|