feat: 선전포고 구현

This commit is contained in:
2021-12-21 03:45:33 +09:00
parent dd6d59cf97
commit c757687eba
4 changed files with 60 additions and 12 deletions
+2 -1
View File
@@ -228,7 +228,8 @@ class che_급습 extends Command\NationCommand
return [
'mapTheme' => \sammo\getMapTheme(),
'procRes' => [
'nations' => $nationList
'nations' => $nationList,
'startYear' => $this->env['startyear'],
],
];
}
@@ -192,6 +192,45 @@ class che_선전포고 extends Command\NationCommand
return true;
}
public function exportJSVars(): array
{
$generalObj = $this->generalObj;
$nationID = $generalObj->getNationID();
$nationList = [];
$testTurn = new LastTurn($this->getName(), null, $this->getPreReqTurn());
foreach (getAllNationStaticInfo() as $destNation) {
/*if ($destNation['nation'] == $nationID) {
continue;
}*/
$testTurn->setArg(['destNationID' => $destNation['nation']]);
$testCommand = new static($generalObj, $this->env, $testTurn, ['destNationID' => $destNation['nation']]);
$nationTarget = [
'id' => $destNation['nation'],
'name' => $destNation['name'],
'color' => $destNation['color'],
'power' => $destNation['power'],
];
if (!$testCommand->hasFullConditionMet()) {
$nationTarget['notAvailable'] = true;
}
if ($destNation['nation'] == $nationID) {
$nationTarget['notAvailable'] = true;
}
$nationList[] = $nationTarget;
}
return [
'mapTheme' => \sammo\getMapTheme(),
'procRes' => [
'nations' => $nationList,
'startYear' => $this->env['startyear'],
],
];
}
public function getJSPlugins(): array
{
return [