징병 모병 추가, iAction 구조 일부 변경

This commit is contained in:
Hide_D committed 2018-10-20 23:31:32 +09:00
1 parent 18ae2f121a
commit 05fcb5397e
50 files changed
+560 -183

No files matched your search

+13
View File
@@ -415,6 +415,19 @@ class Util extends \utilphp\util
{
return self::randF() < $prob;
}
/**
* aaa(.bbb)?% 의 텍스트를 float으로 변환. 100% = 1.0
* @return float|null
*/
public static function convPercentStrToFloat(string $text):?float{
preg_match('/^(\d+(\.\d+)?)\%$/', $text, $matches);
if($matches === null){
return null;
}
return (float)$matches[1] / 100;
}
/**