getPersonalityClass 추가

This commit is contained in:
2018-09-13 02:21:42 +09:00
parent bc4983c771
commit b89d37c8c5
15 changed files with 43 additions and 13 deletions
+20
View File
@@ -238,6 +238,26 @@ function getNationTypeClass(?string $type){
new \InvalidArgumentException("{$type}은 올바른 국가 타입 클래스가 아님");
}
function getPersonalityClass(?string $type){
if($type === null){
$type = GameConst::$neutralPersonality;
}
static $basePath = __NAMESPACE__.'\\TriggerPersonality\\';
$classPath = ($basePath.$type);
if(class_exists($classPath)){
return $classPath;
}
$classPath = ($basePath.'che_'.$type);
if(class_exists($classPath)){
return $classPath;
}
new \InvalidArgumentException("{$type}은 올바른 성격 클래스가 아님");
}
function getGeneralSpecialDomesticClass(?string $type){
if($type === null){
$type = GameConst::$defaultSpecial;