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

This commit is contained in:
2018-10-20 23:31:32 +09:00
parent cee0d3f03e
commit 2de061203b
50 changed files with 560 additions and 183 deletions
+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;
}
/**