따라 임관 추가

This commit is contained in:
2020-05-08 21:49:05 +09:00
parent f8d8d2122e
commit f8c4eae715
5 changed files with 273 additions and 42 deletions
+13 -38
View File
@@ -34,43 +34,21 @@ class che_임관 extends Command\GeneralCommand{
return false;
}
$destNationID = $this->arg['destNationID']??null;
$destGeneralID = $this->arg['destGeneralID']??null;
if($destGeneralID === null && $destNationID === null){
if($destNationID === null){
return false;
}
if($destGeneralID !== null && $destNationID !== null){
if(!is_int($destNationID)){
return false;
}
if ($destNationID !== null) {
if(!is_int($destNationID)){
return false;
}
if($destNationID < 1){
return false;
}
$this->arg = [
'destNationID' => $destNationID
];
if($destNationID < 1){
return false;
}
else{
if(!is_int($destGeneralID)){
return false;
}
if($destGeneralID < 1){
return false;
}
if($destGeneralID == $this->generalObj->getID()){
return false;
}
$this->arg = [
'destGeneralID' => $destGeneralID
];
}
$this->arg = [
'destNationID' => $destNationID
];
return true;
}
@@ -97,21 +75,18 @@ class che_임관 extends Command\GeneralCommand{
}
public function getCommandDetailTitle():string{
return '지정한 국가로 임관';
}
public function canDisplay():bool{
return $this->env['join_mode'] !== 'onlyRandom';
}
protected function initWithArg()
{
$destGeneralID = $this->arg['destGeneralID']??null;
$destNationID = $this->arg['destNationID']??null;
if($destGeneralID !== null){
$this->setDestGeneral($destGeneralID);
$this->setDestNation($this->destGeneralObj->getVar('nation'));
}
else{
$this->setDestNation($destNationID, ['gennum', 'scout']);
}
$destNationID = $this->arg['destNationID'];
$this->setDestNation($destNationID, ['gennum', 'scout']);
$env = $this->env;
$relYear = $env['year'] - $env['startyear'];