refac(WIP): 파일 위치 변경

This commit is contained in:
2021-12-22 02:06:40 +09:00
parent cde55ab574
commit 291976893a
25 changed files with 465 additions and 312 deletions
+1 -1
View File
@@ -38,7 +38,7 @@
</template>
<script lang="ts">
import ColorSelect from "@/processing/ColorSelect.vue";
import ColorSelect from "@/processing/SelectColor.vue";
import { defineComponent, ref } from "vue";
import { unwrap } from "@/util/unwrap";
import { Args } from "@/processing/args";
@@ -12,9 +12,9 @@
<b-button :pressed="!buyRice" @click="buyRice=false"></b-button>
</b-button-group>
</div>
<div class="col-10 col-md-4">
<div class="col-6 col-md-4">
금액 :
<AmountSelect
<SelectAmount
:amountGuide="amountGuide"
v-model="amount"
:maxAmount="maxAmount"
@@ -30,7 +30,7 @@
</template>
<script lang="ts">
import AmountSelect from "@/processing/AmountSelect.vue";
import SelectAmount from "@/processing/SelectAmount.vue";
import { defineComponent, ref } from "vue";
import { unwrap } from "@/util/unwrap";
import { Args } from "@/processing/args";
@@ -46,7 +46,7 @@ declare const procRes: {
export default defineComponent({
components: {
AmountSelect,
SelectAmount,
TopBackBar,
BottomBar,
},
+3 -3
View File
@@ -9,7 +9,7 @@
<div class="row">
<div class="col-12 col-md-6">
장수 :
<GeneralSelect
<SelectGeneral
:generals="generalList"
:groupByNation="nationList"
:textHelper="textHelpGeneral"
@@ -25,7 +25,7 @@
</template>
<script lang="ts">
import GeneralSelect from "@/processing/GeneralSelect.vue";
import SelectGeneral from "@/processing/SelectGeneral.vue";
import { defineComponent, ref } from "vue";
import { unwrap } from "@/util/unwrap";
import { Args } from "@/processing/args";
@@ -50,7 +50,7 @@ declare const procRes: {
export default defineComponent({
components: {
GeneralSelect,
SelectGeneral,
TopBackBar,
BottomBar,
},
+3 -3
View File
@@ -13,7 +13,7 @@
<div class="row">
<div class="col-12 col-md-6">
장수 :
<GeneralSelect
<SelectGeneral
:generals="generalList"
:textHelper="textHelpGeneral"
v-model="selectedGeneralID"
@@ -28,7 +28,7 @@
</template>
<script lang="ts">
import GeneralSelect from "@/processing/GeneralSelect.vue";
import SelectGeneral from "@/processing/SelectGeneral.vue";
import { defineComponent, ref } from "vue";
import { unwrap } from "@/util/unwrap";
import { Args } from "@/processing/args";
@@ -50,7 +50,7 @@ declare const procRes: {
export default defineComponent({
components: {
GeneralSelect,
SelectGeneral,
TopBackBar,
BottomBar,
},
+3 -3
View File
@@ -10,7 +10,7 @@
<div class="row">
<div class="col-6 col-md-3">
국가 :
<NationSelect :nations="nationList" v-model="selectedNationID" />
<SelectNation :nations="nationList" v-model="selectedNationID" />
</div>
<div class="col-4 col-md-2 d-grid">
<b-button @click="submit">{{ commandName }}</b-button>
@@ -47,7 +47,7 @@
</template>
<script lang="ts">
import NationSelect from "@/processing/NationSelect.vue";
import SelectNation from "@/processing/SelectNation.vue";
import { defineComponent, ref } from "vue";
import { unwrap } from "@/util/unwrap";
import { Args } from "@/processing/args";
@@ -63,7 +63,7 @@ declare const procRes: {
export default defineComponent({
components: {
NationSelect,
SelectNation,
TopBackBar,
BottomBar,
},
@@ -10,7 +10,7 @@
<div class="row">
<div class="col-12 col-md-6">
장수 :
<GeneralSelect
<SelectGeneral
:generals="generalList"
:groupByNation="nationList"
:textHelper="textHelpGeneral"
@@ -51,7 +51,7 @@
</template>
<script lang="ts">
import GeneralSelect from "@/processing/GeneralSelect.vue";
import SelectGeneral from "@/processing/SelectGeneral.vue";
import { defineComponent, ref } from "vue";
import { unwrap } from "@/util/unwrap";
import { Args } from "@/processing/args";
@@ -77,7 +77,7 @@ declare const procRes: {
export default defineComponent({
components: {
GeneralSelect,
SelectGeneral,
TopBackBar,
BottomBar,
},
+10 -11
View File
@@ -7,35 +7,34 @@ import { default as che_임관 } from "./che_임관.vue";
import { default as che_장수대상임관 } from "./che_장수대상임관.vue";
import { default as che_징병 } from "./che_징병.vue";
import { default as CityProcess } from "./CityProcess.vue";
import { default as ProcessCity } from "../ProcessCity.vue";
//TODO: 자주 쓰는 녀석들은 Slot으로 변경
export const commandMap: Record<string, typeof CityProcess> = {
che_강행: CityProcess,
export const commandMap: Record<string, typeof ProcessCity> = {
che_강행: ProcessCity,
che_군량매매,
che_건국,
che_등용,
che_모병: che_징병,
che_선동: CityProcess,
che_선동: ProcessCity,
che_선양,
che_이동: CityProcess,
che_이동: ProcessCity,
che_임관,
che_장수대상임관,
che_징병,
che_첩보: CityProcess,
che_출병: CityProcess,
che_탈취: CityProcess,
che_파괴: CityProcess,
che_화계: CityProcess,
che_첩보: ProcessCity,
che_출병: ProcessCity,
che_탈취: ProcessCity,
che_파괴: ProcessCity,
che_화계: ProcessCity,
}
/*
- 항목들
장수/금쌀/분량 - 증여(포상 이식)
금쌀/분량 - 헌납(군량매매 또는 포상 수정)
도시 - 첩보, 계략(화계 등)
고유 양식 - 숙련전환, 장비매매
@@ -18,7 +18,7 @@
</template>
<script lang="ts">
import ColorSelect from "@/processing/ColorSelect.vue";
import ColorSelect from "@/processing/SelectColor.vue";
import { defineComponent, ref } from "vue";
import { unwrap } from "@/util/unwrap";
import { Args } from "@/processing/args";
+7 -7
View File
@@ -11,7 +11,7 @@
<div class="row">
<div class="col-12 col-md-5">
장수 :
<GeneralSelect
<SelectGeneral
:cities="citiesMap"
:generals="generalList"
:troops="troops"
@@ -26,9 +26,9 @@
<b-button :pressed="!isGold" @click="isGold=false"></b-button>
</b-button-group>
</div>
<div class="col-10 col-md-4">
<div class="col-6 col-md-4">
금액 :
<AmountSelect
<SelectAmount
:amountGuide="amountGuide"
v-model="amount"
:maxAmount="maxAmount"
@@ -44,8 +44,8 @@
</template>
<script lang="ts">
import GeneralSelect from "@/processing/GeneralSelect.vue";
import AmountSelect from "@/processing/AmountSelect.vue";
import SelectGeneral from "@/processing/SelectGeneral.vue";
import SelectAmount from "@/processing/SelectAmount.vue";
import { defineComponent, ref } from "vue";
import { unwrap } from "@/util/unwrap";
import { Args } from "@/processing/args";
@@ -72,8 +72,8 @@ declare const procRes: {
export default defineComponent({
components: {
GeneralSelect,
AmountSelect,
SelectGeneral,
SelectAmount,
TopBackBar,
BottomBar,
},
+39 -12
View File
@@ -11,17 +11,38 @@
/>
<div>
타국에게 원조합니다.<br />
작위별로 금액 제한이 있습니다.<br />
작위별로 금액 제한이 있습니다.<br /><br />
<ul>
<template v-for="({ text, amount }, level) in levelInfo" :key="level">
<li>
<span
:style="{
width: '4em',
display: 'inline-block',
...(level != currentNationLevel
? {}
: {
textDecoration: 'underline',
fontWeight: 'bold',
}),
}"
>{{ text }}</span
>: {{ amount.toLocaleString() }}
</li>
</template>
</ul>
<br />
원조할 국가를 목록에서 선택하세요.<br /><br />
</div>
<div class="row">
<div class="col-6 col-md-3">
국가 :
<NationSelect :nations="nationList" v-model="selectedNationID" />
<SelectNation :nations="nationList" v-model="selectedNationID" />
</div>
<div class="col-6 col-md-0"></div>
<div class="col-10 col-md-5">
<div class="col-8 col-md-4">
:
<AmountSelect
<SelectAmount
:amountGuide="amountGuide"
v-model="goldAmount"
:step="10"
@@ -29,9 +50,9 @@
:minAmount="minAmount"
/>
</div>
<div class="col-10 col-md-5">
<div class="col-8 col-md-4">
:
<AmountSelect
<SelectAmount
:amountGuide="amountGuide"
v-model="riceAmount"
:step="10"
@@ -51,8 +72,8 @@
import MapLegacyTemplate, {
MapCityParsed,
} from "@/components/MapLegacyTemplate.vue";
import NationSelect from "@/processing/NationSelect.vue";
import AmountSelect from "@/processing/AmountSelect.vue";
import SelectNation from "@/processing/SelectNation.vue";
import SelectAmount from "@/processing/SelectAmount.vue";
import { defineComponent, ref } from "vue";
import { unwrap } from "@/util/unwrap";
import { Args } from "@/processing/args";
@@ -65,7 +86,13 @@ declare const commandName: string;
declare const procRes: {
nationList: procNationList;
currentNationLevel: number;
nationLevelText: Record<number, string>;
levelInfo: Record<
number,
{
text: string;
amount: number;
}
>;
minAmount: number;
maxAmount: number;
amountGuide: number[];
@@ -74,8 +101,8 @@ declare const procRes: {
export default defineComponent({
components: {
MapLegacyTemplate,
NationSelect,
AmountSelect,
SelectNation,
SelectAmount,
TopBackBar,
BottomBar,
},
@@ -117,7 +144,7 @@ export default defineComponent({
selectedNationID,
selectedCityObj,
currentNationLevel: procRes.currentNationLevel,
nationLevelText: procRes.nationLevelText,
levelInfo: procRes.levelInfo,
minAmount: ref(procRes.minAmount),
maxAmount: ref(procRes.maxAmount),
amountGuide: procRes.amountGuide,
+6 -6
View File
@@ -18,7 +18,7 @@
<div class="row">
<div class="col-12 col-md-6">
장수 :
<GeneralSelect
<SelectGeneral
:cities="citiesMap"
:generals="generalList"
:troops="troops"
@@ -28,7 +28,7 @@
</div>
<div class="col-6 col-md-4">
도시 :
<CitySelect :cities="citiesMap" v-model="selectedCityID" />
<SelectCity :cities="citiesMap" v-model="selectedCityID" />
</div>
<div class="col-4 col-md-2 d-grid">
<b-button variant="primary" @click="submit">{{ commandName }}</b-button>
@@ -42,8 +42,8 @@
import MapLegacyTemplate, {
MapCityParsed,
} from "@/components/MapLegacyTemplate.vue";
import CitySelect from "@/processing/CitySelect.vue";
import GeneralSelect from "@/processing/GeneralSelect.vue";
import SelectCity from "@/processing/SelectCity.vue";
import SelectGeneral from "@/processing/SelectGeneral.vue";
import { defineComponent, ref } from "vue";
import { unwrap } from "@/util/unwrap";
import { Args } from "@/processing/args";
@@ -72,8 +72,8 @@ declare const procRes: {
export default defineComponent({
components: {
MapLegacyTemplate,
CitySelect,
GeneralSelect,
SelectCity,
SelectGeneral,
TopBackBar,
BottomBar,
},
@@ -9,27 +9,27 @@
:mapTheme="mapTheme"
v-model="selectedCityObj"
/>
<div v-if="(commandName == '선전포고')">
타국에게 선전 포고합니다.<br />
선전 포고할 국가를 목록에서 선택하세요.<br />
고립되지 아국 도시에서 인접한 국가에 선포 가능합니다.<br />
초반제한 해제 2년전부터 선포가 가능합니다. ({{ startYear + 1 }}
1월부터 가능)<br />
현재 선포가 불가능한 국가는 배경색이 <span style="color: red">붉은색</span>으로
표시됩니다.<br />
</div>
<div v-if="(commandName == '급습')">
선택된 국가에 급습을 발동합니다.<br />
<div>
선택된 국가에 피장파장을 발동합니다.<br />
지정한 전략을 상대국이
{{ delayCnt }} 동안 사용할 없게됩니다.<br />
대신 아국 지정한 전략을 {{ postReqTurn }} 동안 사용할 없습니다.<br />
선포, 전쟁중인 상대국에만 가능합니다.<br />
상대 국가를 목록에서 선택하세요.<br />
배경색은 현재 급습 불가능 국가는
현재 피장파장이 불가능 국가는
<span style="color: red">붉은색</span>으로 표시됩니다.<br />
</div>
<div class="row">
<div class="col-6 col-md-3">
국가 :
<NationSelect :nations="nationList" v-model="selectedNationID" />
<SelectNation :nations="nationList" v-model="selectedNationID" />
</div>
<div class="col-4 col-md-2">
<label>전략 :</label>
<b-form-select
:options="commandTypesOption"
v-model="selectedCommandID"
/>
</div>
<div class="col-4 col-md-2 d-grid">
<b-button @click="submit">{{ commandName }}</b-button>
@@ -43,7 +43,7 @@
import MapLegacyTemplate, {
MapCityParsed,
} from "@/components/MapLegacyTemplate.vue";
import NationSelect from "@/processing/NationSelect.vue";
import SelectNation from "@/processing/SelectNation.vue";
import { defineComponent, ref } from "vue";
import { unwrap } from "@/util/unwrap";
import { Args } from "@/processing/args";
@@ -55,13 +55,22 @@ declare const commandName: string;
declare const procRes: {
nationList: procNationList;
startYear: number,
startYear: number;
delayCnt: number;
postReqTurn: number;
availableCommandTypeList: Record<
number,
{
name: string;
remainTurn: number;
}
>;
};
export default defineComponent({
components: {
MapLegacyTemplate,
NationSelect,
SelectNation,
TopBackBar,
BottomBar,
},
@@ -80,7 +89,23 @@ export default defineComponent({
}
const selectedNationID = ref(procRes.nationList[0].id);
const selectedCityObj = ref();//mapping
const selectedCityObj = ref(); //mapping
const commandTypesOption: { html: string; value: string }[] = [];
for (const [commandTypeID, commandTypeInfo] of Object.entries(procRes.availableCommandTypeList)) {
const notAvailable = commandTypeInfo.remainTurn > 0;
const notAvailableText = notAvailable?' (불가)':'';
const name = `${commandTypeInfo.name}${notAvailableText}`;
const html = notAvailable?`<span style='color:red;'>${name}</span>`:name;
commandTypesOption.push({
html,
value: commandTypeID,
});
}
const selectedCommandID = ref(
Object.keys(procRes.availableCommandTypeList)[0]
);
function selectedNation(nationID: number) {
selectedNationID.value = nationID;
@@ -90,13 +115,16 @@ export default defineComponent({
const event = new CustomEvent<Args>("customSubmit", {
detail: {
destNationID: selectedNationID.value,
commandType: selectedCommandID.value,
},
});
unwrap(e.target).dispatchEvent(event);
}
return {
startYear: procRes.startYear,
...procRes,
selectedCommandID,
commandTypesOption,
mapTheme: ref(mapTheme),
nationList: ref(nationList),
selectedCityObj,
+15 -12
View File
@@ -1,27 +1,30 @@
import { default as che_국기변경 } from "./che_국기변경.vue";
import { default as che_국호변경 } from "./che_국호변경.vue";
import { default as che_물자원조 } from "./che_물자원조.vue";
import { default as che_피장파장 } from "./che_피장파장.vue";
import { default as NationProcess } from "./che_선전포고.vue";
import { default as GeneralAmountProcess } from "./che_몰수.vue";
import { default as GeneralCityProcess } from "./che_발령.vue";
import { default as ProcessNation } from "../ProcessNation.vue";
import { default as ProcessGeneralAmount } from "./che_몰수.vue";
import { default as ProcessGeneralCity } from "./che_발령.vue";
export const commandMap: Record<string, typeof NationProcess> = {
export const commandMap: Record<string, typeof ProcessNation> = {
che_국기변경,
che_국호변경,
che_급습: NationProcess,
che_몰수: GeneralAmountProcess,
che_급습: ProcessNation,
che_몰수: ProcessGeneralAmount,
che_물자원조,
che_선전포고: NationProcess,
che_포상: GeneralAmountProcess,
che_발령: GeneralCityProcess,
che_발령: ProcessGeneralCity,
che_불가침파기제의: ProcessNation,
che_선전포고: ProcessNation,
che_이호경식: ProcessNation,
che_종전제의: ProcessNation,
che_포상: ProcessGeneralAmount,
che_피장파장,
}
/*
- 항목들
국가/금쌀/분량 - 물자원조
도시 - 백성동원, 수몰, 천도, 초토화,
국가 - 불가침파기제의, 선전포고, 이호경식, 종전제의, 피장파장, 허보
도시 - 백성동원, 수몰, 천도, 초토화, 허보
고유 양식 - 불가침제의
*/
@@ -38,7 +38,7 @@
<div class="row">
<div class="col-4 col-md-2">
도시:
<CitySelect :cities="citiesMap" v-model="selectedCityID" />
<SelectCity :cities="citiesMap" v-model="selectedCityID" />
</div>
<div class="col-4 col-md-2 d-grid">
<b-button @click="submit">{{ commandName }}</b-button>
@@ -57,7 +57,7 @@
import MapLegacyTemplate, {
MapCityParsed,
} from "@/components/MapLegacyTemplate.vue";
import CitySelect from "@/processing/CitySelect.vue";
import SelectCity from "@/processing/SelectCity.vue";
import CityBasedOnDistance from "@/processing/CitiesBasedOnDistance.vue";
import { defineComponent, ref } from "vue";
import { unwrap } from "@/util/unwrap";
@@ -75,7 +75,7 @@ declare const procRes: {
export default defineComponent({
components: {
MapLegacyTemplate,
CitySelect,
SelectCity,
CityBasedOnDistance,
TopBackBar,
BottomBar,
+135
View File
@@ -0,0 +1,135 @@
<template>
<TopBackBar :title="commandName" type="chief" />
<div class="bg0">
<MapLegacyTemplate
:isDetailMap="false"
:clickableAll="true"
:neutralView="true"
:useCachedMap="true"
:mapTheme="mapTheme"
v-model="selectedCityObj"
/>
<div v-if="commandName == '선전포고'">
타국에게 선전 포고합니다.<br />
선전 포고할 국가를 목록에서 선택하세요.<br />
고립되지 않은 아국 도시에서 인접한 국가에 선포 가능합니다.<br />
초반제한 해제 2년전부터 선포가 가능합니다. ({{ startYear + 1 }} 1월부터
가능)<br />
현재 선포가 불가능한 국가는 배경색이
<span style="color: red">붉은색</span>으로 표시됩니다.<br />
</div>
<div v-else-if="commandName == '급습'">
선택된 국가에 급습을 발동합니다.<br />
선포, 전쟁중인 상대국에만 가능합니다.<br />
상대 국가를 목록에서 선택하세요.<br />
현재 급습이 불가능한 국가는
<span style="color: red">붉은색</span>으로 표시됩니다.<br />
</div>
<div v-else-if="commandName == '불가침 파기 제의'">
불가침중인 국가에 조약 파기를 제의합니다.<br />
제의할 국가를 목록에서 선택하세요.<br />
현재 제의가 불가능한 국가는
<span style="color: red">붉은색</span>으로 표시됩니다.<br />
</div>
<div v-else-if="commandName == '이호경식'">
선택된 국가에 이호경식을 발동합니다.<br />
선포, 전쟁중인 상대국에만 가능합니다.<br />
상대 국가를 목록에서 선택하세요.<br />
현재 이호경식이 불가능한 국가는
<span style="color: red">붉은색</span>으로 표시됩니다.<br />
</div>
<div v-else-if="commandName == '종전 제의'">
전쟁중인 국가에 종전을 제의합니다.<br />
제의할 국가를 목록에서 선택하세요.<br />
현재 제의가 불가능한 국가는
<span style="color: red">붉은색</span>으로 표시됩니다.<br />
</div>
<div v-else-if="commandName == '허보'">
전쟁중인 국가에 종전을 제의합니다.<br />
제의할 국가를 목록에서 선택하세요.<br />
현재 제의가 불가능한 국가는
<span style="color: red">붉은색</span>으로 표시됩니다.<br />
</div>
<div class="row">
<div class="col-6 col-md-3">
국가 :
<SelectNation :nations="nationList" v-model="selectedNationID" />
</div>
<div class="col-4 col-md-2 d-grid">
<b-button @click="submit">{{ commandName }}</b-button>
</div>
</div>
</div>
<BottomBar :title="commandName" />
</template>
<script lang="ts">
import MapLegacyTemplate, {
MapCityParsed,
} from "@/components/MapLegacyTemplate.vue";
import SelectNation from "@/processing/SelectNation.vue";
import { defineComponent, ref } from "vue";
import { unwrap } from "@/util/unwrap";
import { Args } from "@/processing/args";
import TopBackBar from "@/components/TopBackBar.vue";
import BottomBar from "@/components/BottomBar.vue";
import { procNationItem, procNationList } from "./processingRes";
declare const mapTheme: string;
declare const commandName: string;
declare const procRes: {
nationList: procNationList;
startYear: number;
};
export default defineComponent({
components: {
MapLegacyTemplate,
SelectNation,
TopBackBar,
BottomBar,
},
watch: {
selectedCityObj(city: MapCityParsed) {
if (!city.nationID) {
return;
}
this.selectedNationID = city.nationID;
},
},
setup() {
const nationList = new Map<number, procNationItem>();
for (const nationItem of procRes.nationList) {
nationList.set(nationItem.id, nationItem);
}
const selectedNationID = ref(procRes.nationList[0].id);
const selectedCityObj = ref(); //mapping용
function selectedNation(nationID: number) {
selectedNationID.value = nationID;
}
async function submit(e: Event) {
const event = new CustomEvent<Args>("customSubmit", {
detail: {
destNationID: selectedNationID.value,
},
});
unwrap(e.target).dispatchEvent(event);
}
return {
startYear: procRes.startYear,
mapTheme: ref(mapTheme),
nationList: ref(nationList),
selectedCityObj,
selectedNationID,
commandName,
selectedNation,
submit,
};
},
});
</script>
@@ -1,19 +1,22 @@
<template>
<div class="input-group">
<b-button
v-if="maxAmount > 30000"
v-if="maxAmount > 20000"
class="btn-sm"
@click="amount = Math.max(amount - 10000, minAmount)"
>-1</b-button
>-</b-button
>
<b-button
v-if="maxAmount > 3000"
v-if="maxAmount > 2000"
class="btn-sm"
@click="amount = Math.max(amount - 1000, minAmount)"
>-1</b-button
>-</b-button
>
<b-button
v-if="maxAmount > 300"
v-if="maxAmount > 200"
class="btn-sm"
@click="amount = Math.max(amount - 100, minAmount)"
>-1</b-button
>-</b-button
>
<input
type="number"
@@ -35,19 +38,22 @@
>
</b-dropdown>
<b-button
v-if="maxAmount > 300"
v-if="maxAmount > 200"
class="btn-sm"
@click="amount = Math.min(amount + 100, maxAmount)"
>+1</b-button
>+</b-button
>
<b-button
v-if="maxAmount > 3000"
v-if="maxAmount > 2000"
class="btn-sm"
@click="amount = Math.min(amount + 1000, maxAmount)"
>+1</b-button
>+</b-button
>
<b-button
v-if="maxAmount > 30000"
v-if="maxAmount > 20000"
class="btn-sm"
@click="amount = Math.min(amount + 10000, maxAmount)"
>+1</b-button
>+</b-button
>
</div>
</template>
@@ -76,7 +82,7 @@ export default defineComponent({
type: Number,
required: false,
default: 1,
}
},
},
emits: ["update:modelValue"],
watch: {