글자 너비를 반각 18자까지 확장

This commit is contained in:
2018-10-29 02:39:23 +09:00
parent 2cc0150bec
commit 13fab5ebe4
13 changed files with 174 additions and 14 deletions
+19 -1
View File
@@ -17,6 +17,7 @@ use function \sammo\{
use \sammo\Constraint\Constraint;
use sammo\CityConst;
use function sammo\getNationTypeClass;
@@ -26,7 +27,7 @@ class che_건국 extends Command\GeneralCommand{
protected function argTest():bool{
$nationName = $this->arg['nationName']??null;
$nationType = $this->arg['nationType']??null;
$colorType = $this->arg['colotType']??null;
$colorType = $this->arg['colorType']??null;
if($nationName === null || $nationType === null || $colorType === null){
return false;
@@ -36,6 +37,23 @@ class che_건국 extends Command\GeneralCommand{
return false;
}
if(mb_strwidth($nationName) > 18){
return false;
}
try{
$nationTypeClass = getNationTypeClass($nationType);
}
catch(InvalidArgumentException $e){
return false;
}
$this->arg = [
'nationName'=>$nationName,
'nationType'=>$nationType,
'colorType'=>$colorType
];
return true;
}