argTest를 로직 순서에 맞게 변경
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user