argTest를 로직 순서에 맞게 변경

This commit is contained in:
2018-10-21 14:28:29 +09:00
parent c71a92302a
commit 3cc437a17f
27 changed files with 289 additions and 304 deletions
+19 -19
View File
@@ -32,6 +32,25 @@ class che_장비매매 extends Command\GeneralCommand{
'item'=>'도구',
];
protected function argTest():bool{
$itemType = $this->arg['itemType']??null;
if(!in_array($itemType, array_keys(static::$itemMap))){
return false;
}
$itemCode = $this->arg['itemCode']??null;
if(!is_int($itemCode)){
return false;
}
if($itemCode < 0 || 6 < $itemCode){
return false;
}
$this->arg = [
'itemType'=>$itemType,
'itemCode'=>$itemCode
];
return true;
}
protected function init(){
$general = $this->generalObj;
@@ -64,25 +83,6 @@ class che_장비매매 extends Command\GeneralCommand{
}
protected function argTest():bool{
$itemType = $this->arg['itemType']??null;
if(!in_array($itemType, array_keys(static::$itemMap))){
return false;
}
$itemCode = $this->arg['itemCode']??null;
if(!is_int($itemCode)){
return false;
}
if($itemCode < 0 || 6 < $itemCode){
return false;
}
$this->arg = [
'itemType'=>$itemType,
'itemCode'=>$itemCode
];
return true;
}
public function getCost():array{
if(!$this->isArgValid){
return [0, 0];