From 72f7811f3dd845f6c9fd1c998ec505ae019fd363 Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 19 Dec 2021 17:22:54 +0900 Subject: [PATCH] =?UTF-8?q?feat(WIP):=20processing=EC=97=90=EC=84=9C=20vue?= =?UTF-8?q?=20=EA=B0=9D=EC=B2=B4=20=ED=86=B5=ED=95=A9,=20lazy=20loading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/Command/General/che_출병.php | 2 + hwe/sammo/Command/Nation/che_몰수.php | 50 ------------ hwe/sammo/Command/Nation/che_포상.php | 61 ++++---------- hwe/ts/processing/General/che_강행.vue | 107 ------------------------- hwe/ts/processing/General/che_이동.vue | 18 ++++- hwe/ts/processing/General/che_출병.vue | 96 ---------------------- hwe/ts/processing/General/index.ts | 10 ++- hwe/ts/processing/Nation/che_몰수.vue | 6 +- hwe/ts/processing/Nation/che_발령.vue | 2 +- hwe/ts/processing/Nation/index.ts | 19 +++-- hwe/ts/v_processing.ts | 8 +- 11 files changed, 61 insertions(+), 318 deletions(-) delete mode 100644 hwe/ts/processing/General/che_강행.vue delete mode 100644 hwe/ts/processing/General/che_출병.vue diff --git a/hwe/sammo/Command/General/che_출병.php b/hwe/sammo/Command/General/che_출병.php index 42274d9c..2c7ca7ea 100644 --- a/hwe/sammo/Command/General/che_출병.php +++ b/hwe/sammo/Command/General/che_출병.php @@ -2,6 +2,7 @@ namespace sammo\Command\General; +use phpDocumentor\Reflection\Types\Object_; use \sammo\DB; use \sammo\Util; use \sammo\JosaUtil; @@ -246,6 +247,7 @@ class che_출병 extends Command\GeneralCommand 'mapTheme' => \sammo\getMapTheme(), 'procRes' => [ 'cities' => \sammo\JSOptionsForCities(), + 'distanceList' => new \StdClass(), ], ]; } diff --git a/hwe/sammo/Command/Nation/che_몰수.php b/hwe/sammo/Command/Nation/che_몰수.php index 0e58a481..42cf261a 100644 --- a/hwe/sammo/Command/Nation/che_몰수.php +++ b/hwe/sammo/Command/Nation/che_몰수.php @@ -232,54 +232,4 @@ class che_몰수 extends Command\NationCommand ] ]; } - - public function getForm(): string - { - //TODO: 암행부처럼 보여야... - $db = DB::db(); - - $destRawGenerals = $db->query('SELECT no,name,officer_level,npc,gold,rice FROM general WHERE nation = %i ORDER BY npc,binary(name)', $this->generalObj->getNationID()); - $destGeneralList = []; - foreach ($destRawGenerals as $destGeneral) { - $nameColor = \sammo\getNameColor($destGeneral['npc']); - if ($nameColor) { - $nameColor = " style='color:{$nameColor}'"; - } - - $name = $destGeneral['name']; - if ($destGeneral['officer_level'] >= 5) { - $name = "*{$name}*"; - } - - $destGeneralList[] = [ - 'no' => $destGeneral['no'], - 'color' => $nameColor, - 'name' => $name, - 'gold' => $destGeneral['gold'], - 'rice' => $destGeneral['rice'] - ]; - } - ob_start(); -?> - 장수의 자금이나 군량을 몰수합니다.
- 몰수한것은 국가재산으로 귀속됩니다.
- - - -
-
-query('SELECT no,name,officer_level,npc,gold,rice FROM general WHERE nation = %i ORDER BY npc,binary(name)', $this->generalObj->getNationID()); - $destGeneralList = []; - foreach ($destRawGenerals as $destGeneral) { - $nameColor = \sammo\getNameColor($destGeneral['npc']); - if ($nameColor) { - $nameColor = " style='color:{$nameColor}'"; - } - - $name = $destGeneral['name']; - if ($destGeneral['officer_level'] >= 5) { - $name = "*{$name}*"; - } - - $destGeneralList[] = [ - 'no' => $destGeneral['no'], - 'color' => $nameColor, - 'name' => $name, - 'gold' => $destGeneral['gold'], - 'rice' => $destGeneral['rice'] - ]; - } - ob_start(); -?> - 국고로 장수에게 자금이나 군량을 지급합니다.
- - - -
-
-getNationID(); + $troops = Util::convertArrayToDict($db->query('SELECT * FROM troop WHERE nation=%i', $nationID), 'troop_leader'); + $destRawGenerals = $db->queryAllLists('SELECT no,name,officer_level,npc,gold,rice,leadership,strength,intel,city,crew,train,atmos,troop FROM general WHERE nation = %i ORDER BY npc,binary(name)', $nationID); + return [ + 'procRes' => [ + 'troops' => $troops, + 'generals' => $destRawGenerals, + 'generalsKey' => ['no', 'name', 'officerLevel', 'npc', 'gold', 'rice', 'leadership', 'strength', 'intel', 'cityID', 'crew', 'train', 'atmos', 'troopID'], + 'cities' => \sammo\JSOptionsForCities(), + 'minAmount' => 100, + 'maxAmount' => GameConst::$maxResourceActionAmount, + 'amountGuide' => GameConst::$resourceActionAmountGuide, + ] + ]; } } diff --git a/hwe/ts/processing/General/che_강행.vue b/hwe/ts/processing/General/che_강행.vue deleted file mode 100644 index 8b92005e..00000000 --- a/hwe/ts/processing/General/che_강행.vue +++ /dev/null @@ -1,107 +0,0 @@ - - - diff --git a/hwe/ts/processing/General/che_이동.vue b/hwe/ts/processing/General/che_이동.vue index be74fe18..e1b30294 100644 --- a/hwe/ts/processing/General/che_이동.vue +++ b/hwe/ts/processing/General/che_이동.vue @@ -10,11 +10,21 @@ v-model="selectedCityObj" /> -
+
+ 선택된 도시로 강행합니다.
+ 최대 3칸내 도시로만 강행이 가능합니다.
+ 목록을 선택하거나 도시를 클릭하세요.
+
+
선택된 도시로 이동합니다.
인접 도시로만 이동이 가능합니다.
목록을 선택하거나 도시를 클릭하세요.
+
+ 선택된 도시를 향해 침공을 합니다.
+ 침공 경로에 적군의 도시가 있다면 전투를 벌입니다.
+ 목록을 선택하거나 도시를 클릭하세요.
+
@@ -47,9 +57,9 @@ declare const mapTheme: string; declare const currentCity: number; declare const commandName: string; declare const procRes: { - distanceList: Record, - cities: [number, string][], -} + distanceList: Record; + cities: [number, string][]; +}; export default defineComponent({ components: { MapLegacyTemplate, diff --git a/hwe/ts/processing/General/che_출병.vue b/hwe/ts/processing/General/che_출병.vue deleted file mode 100644 index 2489570d..00000000 --- a/hwe/ts/processing/General/che_출병.vue +++ /dev/null @@ -1,96 +0,0 @@ - - - diff --git a/hwe/ts/processing/General/index.ts b/hwe/ts/processing/General/index.ts index c7514e1b..359e441f 100644 --- a/hwe/ts/processing/General/index.ts +++ b/hwe/ts/processing/General/index.ts @@ -1,3 +1,7 @@ -export { default as che_강행 } from "./che_강행.vue"; -export { default as che_이동 } from "./che_이동.vue"; -export { default as che_출병 } from "./che_출병.vue"; \ No newline at end of file +import { default as CityProcess} from "./che_이동.vue"; + +export const commandMap: Recordtypeof CityProcess> = { + che_강행: ()=>CityProcess, + che_이동: ()=>CityProcess, + che_출병: ()=>CityProcess, +} \ No newline at end of file diff --git a/hwe/ts/processing/Nation/che_몰수.vue b/hwe/ts/processing/Nation/che_몰수.vue index e3f68332..bd90d2a5 100644 --- a/hwe/ts/processing/Nation/che_몰수.vue +++ b/hwe/ts/processing/Nation/che_몰수.vue @@ -1,10 +1,13 @@