From a146cb69d0ea315c383b05ac0fc303709a9bdaaa Mon Sep 17 00:00:00 2001 From: hide_d Date: Thu, 29 Mar 2018 00:50:35 +0900 Subject: [PATCH] =?UTF-8?q?j=5Fload=5Fscenario.php=20=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EB=B3=BC=20=EC=88=98=20=EC=9E=88=EB=8A=94=20=EC=9A=94=EC=95=BD?= =?UTF-8?q?=20=ED=98=95=ED=83=9C=EB=B3=B8=20=EC=B6=94=EA=B0=80=20-=20?= =?UTF-8?q?=EC=86=8C=EC=86=8C=ED=95=9C=20=EB=B2=84=EA=B7=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- twe/func_converter.php | 2 ++ twe/j_load_scenarios.php | 1 + twe/sammo/Scenario.php | 4 +++- twe/sammo/Scenario/NPC.php | 2 +- twe/sammo/Scenario/Nation.php | 17 +++++++++++++++++ 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/twe/func_converter.php b/twe/func_converter.php index 102e36a6..9e2265c4 100644 --- a/twe/func_converter.php +++ b/twe/func_converter.php @@ -1,5 +1,7 @@ setReadOnly(); if($session->userGrade < 5){ Json::die([ diff --git a/twe/sammo/Scenario.php b/twe/sammo/Scenario.php index af30c0fa..b5afb8f7 100644 --- a/twe/sammo/Scenario.php +++ b/twe/sammo/Scenario.php @@ -238,7 +238,9 @@ class Scenario{ 'title'=>$this->getTitle(), 'npc_cnt'=>count($this->getNPC()), 'npcEx_cnt'=>count($this->getNPCex()), - 'nation'=>$this->getNation() + 'nation'=>array_map(function($nation){ + return $nation->getBrief(); + },$this->getNation()) ]; } diff --git a/twe/sammo/Scenario/NPC.php b/twe/sammo/Scenario/NPC.php index e4dff203..5059fc47 100644 --- a/twe/sammo/Scenario/NPC.php +++ b/twe/sammo/Scenario/NPC.php @@ -26,7 +26,7 @@ class NPC{ string $name, int $pictureID, int $nationID, - string $locatedCity, + $locatedCity, //FIXME: 7.1로 올릴 때 ?string 으로 변경 int $leadership, int $power, int $intel, diff --git a/twe/sammo/Scenario/Nation.php b/twe/sammo/Scenario/Nation.php index 268d28d5..7f04417e 100644 --- a/twe/sammo/Scenario/Nation.php +++ b/twe/sammo/Scenario/Nation.php @@ -117,4 +117,21 @@ class Nation{ } $db->insert('diplomacy', $diplomacy); } + + public function getBrief(){ + return [ + 'id'=>$this->id, + 'name'=>$this->name, + 'color'=>$this->color, + 'gold'=>$this->gold, + 'rice'=>$this->rice, + 'infoText'=>$this->infoText, + 'tech'=>$this->tech, + 'type'=>$this->type, + 'nationLevel'=>$this->nationLevel, + 'cities'=>$this->cities, + 'generals'=>count($this->generals), + 'generalsEx'=>count($this->generalsEx) + ]; + } } \ No newline at end of file