feat(WIP): 세력장수 변경사항 반영

This commit is contained in:
2022-04-07 03:03:38 +09:00
parent f3df6db607
commit d456504225
7 changed files with 397 additions and 210 deletions
+6 -2
View File
@@ -11,6 +11,7 @@ use sammo\Validator;
use function sammo\calcLeadershipBonus; use function sammo\calcLeadershipBonus;
use function sammo\checkLimit; use function sammo\checkLimit;
use function sammo\checkSecretPermission; use function sammo\checkSecretPermission;
use function sammo\getBillByLevel;
use function sammo\getDedLevelText; use function sammo\getDedLevelText;
use function sammo\getGenChar; use function sammo\getGenChar;
use function sammo\getGeneralSpecialDomesticName; use function sammo\getGeneralSpecialDomesticName;
@@ -117,6 +118,8 @@ class GeneralList extends \sammo\BaseAPI
'lbonus' => 0, 'lbonus' => 0,
'ownerName' => 0, 'ownerName' => 0,
'honorText' => 0, 'honorText' => 0,
'dedLevelText' => 0,
'bill' => 0,
]; ];
@@ -150,12 +153,13 @@ class GeneralList extends \sammo\BaseAPI
return getHonor($rawGeneral['experience']); return getHonor($rawGeneral['experience']);
}, },
'dedLevelText' => function ($rawGeneral) { 'dedLevelText' => function ($rawGeneral) {
return getDedLevelText($rawGeneral['dedLevel']); return getDedLevelText($rawGeneral['dedlevel']);
}, },
'turntime' => function ($rawGeneral) { 'turntime' => function ($rawGeneral) {
//'0000-00-00 11:23'; //'0000-00-00 11:23';
return substr($rawGeneral['turntime'], 11, 5); return substr($rawGeneral['turntime'], 11, 5);
} },
'bill' => fn($rawGeneral) => getBillByLevel($rawGeneral['dedlevel'])
]; ];
+1 -1
View File
@@ -10,7 +10,7 @@
<?=$btnBegin??''?><a href='b_tournament.php' target='_blank' class='open-window <?=$btnClassForTournament??""?>'>토 너 먼 트</a><?=$btnEnd??''?> <?=$btnBegin??''?><a href='b_tournament.php' target='_blank' class='open-window <?=$btnClassForTournament??""?>'>토 너 먼 트</a><?=$btnEnd??''?>
<?=$btnBegin??''?><a href='b_myKingdomInfo.php' class='commandButton <?=$btnClass??""?> <?= $meLevel >= 1 ? '' : 'disabled' ?>'>세력 정보</a><?=$btnEnd??''?> <?=$btnBegin??''?><a href='b_myKingdomInfo.php' class='commandButton <?=$btnClass??""?> <?= $meLevel >= 1 ? '' : 'disabled' ?>'>세력 정보</a><?=$btnEnd??''?>
<?=$btnBegin??''?><a href='b_myCityInfo.php' class='commandButton <?=$btnClass??""?> <?= ($meLevel >= 1 && $nationLevel >= 1) ? '' : 'disabled' ?>'>세력 도시</a><?=$btnEnd??''?> <?=$btnBegin??''?><a href='b_myCityInfo.php' class='commandButton <?=$btnClass??""?> <?= ($meLevel >= 1 && $nationLevel >= 1) ? '' : 'disabled' ?>'>세력 도시</a><?=$btnEnd??''?>
<?=$btnBegin??''?><a href='b_myGenInfo.php' class='commandButton <?=$btnClass??""?> <?= $meLevel >= 1 ? '' : 'disabled' ?>'>세력 장수</a><?=$btnEnd??''?> <?=$btnBegin??''?><a href='v_nationGeneral.php' class='commandButton <?=$btnClass??""?> <?= $meLevel >= 1 ? '' : 'disabled' ?>'>세력 장수</a><?=$btnEnd??''?>
<?=$btnBegin??''?><a href='b_diplomacy.php' class='commandButton <?=$btnClass??""?>'>중원 정보</a><?=$btnEnd??''?> <?=$btnBegin??''?><a href='b_diplomacy.php' class='commandButton <?=$btnClass??""?>'>중원 정보</a><?=$btnEnd??''?>
<?=$btnBegin??''?><a href='b_currentCity.php' class='commandButton <?=$btnClass??""?>'>현재 도시</a><?=$btnEnd??''?> <?=$btnBegin??''?><a href='b_currentCity.php' class='commandButton <?=$btnClass??""?>'>현재 도시</a><?=$btnEnd??''?>
<?=$btnBegin??''?><a href='b_battleCenter.php' target='_blank' class='open-window commandButton <?=$btnClass??""?> <?= $showSecret ? '' : 'disabled' ?>'>감 찰 부</a><?=$btnEnd??''?> <?=$btnBegin??''?><a href='b_battleCenter.php' target='_blank' class='open-window commandButton <?=$btnClass??""?> <?= $showSecret ? '' : 'disabled' ?>'>감 찰 부</a><?=$btnEnd??''?>
+6 -1
View File
@@ -1,7 +1,12 @@
<template> <template>
<BContainer id="container" :toast="{ root: true }" class="pageNationGeneral bg0"> <BContainer id="container" :toast="{ root: true }" class="pageNationGeneral bg0">
<TopBackBar :title="title" /> <TopBackBar :title="title" />
<GeneralList :list="generalList" :height="'fill'" /> <Suspense>
<GeneralList :list="generalList" :height="'fill'" />
<template #fallback>
불러오는 중입니다...
</template>
</Suspense>
<BottomBar /> <BottomBar />
</BContainer> </BContainer>
</template> </template>
+2 -1
View File
@@ -9,7 +9,7 @@ import type { BettingDetailResponse, BettingListResponse } from "./defs/API/Bett
import type { ReserveBulkCommandResponse, ReserveCommandResponse, ReservedCommandResponse } from "./defs/API/Command"; import type { ReserveBulkCommandResponse, ReserveCommandResponse, ReservedCommandResponse } from "./defs/API/Command";
import type { ChiefResponse } from "./defs/API/NationCommand"; import type { ChiefResponse } from "./defs/API/NationCommand";
import type { inheritBuffType } from "./defs/API/InheritAction"; import type { inheritBuffType } from "./defs/API/InheritAction";
import type { SetBlockWarResponse } from "./defs/API/Nation"; import type { SetBlockWarResponse, GeneralListResponse as NationGeneralListResponse } from "./defs/API/Nation";
import type { UploadImageResponse } from "./defs/API/Misc"; import type { UploadImageResponse } from "./defs/API/Misc";
import type { JoinArgs } from "./defs/API/General"; import type { JoinArgs } from "./defs/API/General";
import type { GetConstResponse } from "./defs/API/Global"; import type { GetConstResponse } from "./defs/API/Global";
@@ -96,6 +96,7 @@ const apiRealPath = {
}[], ReserveBulkCommandResponse>, }[], ReserveBulkCommandResponse>,
}, },
Nation: { Nation: {
GeneralList: GET as APICallT<undefined, NationGeneralListResponse>,
SetNotice: PUT as APICallT<{ SetNotice: PUT as APICallT<{
msg: string, msg: string,
}>, }>,
+305 -129
View File
@@ -8,6 +8,7 @@
<AgGridVue <AgGridVue
style="width: 100%; height: 100%" style="width: 100%; height: 100%"
class="ag-theme-balham-dark" class="ag-theme-balham-dark"
:getRowId="getRowId"
:rowHeight="rowHeight" :rowHeight="rowHeight"
:columnDefs="columnDefs" :columnDefs="columnDefs"
:rowData="list" :rowData="list"
@@ -22,8 +23,21 @@ import type { GeneralListItem, GeneralListItemP2 } from "@/defs/API/Nation";
import { getIconPath } from "@/util/getIconPath"; import { getIconPath } from "@/util/getIconPath";
import { ref, watch, type PropType, type StyleValue } from "vue"; import { ref, watch, type PropType, type StyleValue } from "vue";
import { AgGridVue } from "ag-grid-vue3"; import { AgGridVue } from "ag-grid-vue3";
import type { CellClassParams, CellStyle, ColDef, ColumnApi, GridApi, GridReadyEvent } from "ag-grid-community"; import type {
CellClassParams,
CellStyle,
ColDef,
ColGroupDef,
ColumnApi,
GetRowIdParams,
GridApi,
GridReadyEvent,
} from "ag-grid-community";
import { getNpcColor } from "@/common_legacy"; import { getNpcColor } from "@/common_legacy";
import type {
BaseWithValueColDefParams,
ValueGetterParams,
} from "ag-grid-community/dist/lib/entities/colDef";
const props = defineProps({ const props = defineProps({
list: { list: {
@@ -32,16 +46,21 @@ const props = defineProps({
}, },
height: { height: {
type: String as PropType<'static' | 'fill' | number | `${number}px`| `${number}%`>, type: String as PropType<"static" | "fill" | number | `${number}px` | `${number}%`>,
required: false, required: false,
default: 'static', default: "static",
}, },
}); });
//debug
console.log(`list`, props.list);
watch( watch(
() => props.list, () => props.list,
() => { () => {
setTimeout(() => { setTimeout(() => {
//debug
console.log(`list`, props.list);
gridApi.value?.redrawRows(); gridApi.value?.redrawRows();
}, 0); }, 0);
} }
@@ -50,7 +69,7 @@ watch(
watch( watch(
() => props.height, () => props.height,
(val) => { (val) => {
if (val === 'static') { if (val === "static") {
gridApi.value?.setDomLayout("autoHeight"); gridApi.value?.setDomLayout("autoHeight");
} else { } else {
gridApi.value?.setDomLayout("normal"); gridApi.value?.setDomLayout("normal");
@@ -63,76 +82,106 @@ const columnApi = ref<ColumnApi>();
const rowHeight = ref(28); const rowHeight = ref(28);
function getRowId(params: GetRowIdParams): string {
const genID = (params.data as GeneralListItem).no;
return `${genID}`;
}
function onGridReady(params: GridReadyEvent) { function onGridReady(params: GridReadyEvent) {
gridApi.value = params.api; gridApi.value = params.api;
columnApi.value = params.columnApi; columnApi.value = params.columnApi;
if (props.height === 'static') { if (props.height === "static") {
params.api.setDomLayout("autoHeight"); params.api.setDomLayout("autoHeight");
} } else {
else{ params.api.setDomLayout("normal");
params.api.setDomLayout('normal');
} }
setRowHeight(); setRowHeight();
params.api.sizeColumnsToFit();
} }
function setRowHeight() { function setRowHeight() {
if (!columnRawDefs.value.icon?.hide) { if (!(columnRawDefs.value.icon as GenColDef | undefined)?.hide) {
rowHeight.value = 64 + 4; rowHeight.value = 64 + 4;
return; return;
} }
rowHeight.value = gridApi.value?.getSizesForCurrentTheme().rowHeight ?? 28; rowHeight.value = gridApi.value?.getSizesForCurrentTheme().rowHeight ?? 28;
} }
type headerInfo = {
title: string;
info?: string;
isEnum?: boolean; //default: false
sortable?: "asc" | "desc" | false | undefined | null; //default: false
searchable?: boolean; //default: false
type?: "both" | "display" | "filter" | "custom"; //default: both
converter?: (a: GeneralListItem) => string;
subType?: Partial<Record<headerType, headerInfo>>; //n행 표기 시
style?: StyleValue;
};
type headerType = type headerType =
| keyof Omit<GeneralListItemP2, "no" | "imgsvr" | "picture" | "lbonus" | "officerLevelText"> | keyof Omit<GeneralListItemP2, "no" | "imgsvr" | "picture" | "lbonus">
| "stat" | "stat"
| "icon" | "icon"
| "goldRice" | "goldRice"
| "expDedLv" | "expDedLv"
| "specials" | "specials"
| "killturnAndConnect"; | "killturnAndConnect"
| "years";
type GenColDef = ColDef & { interface GenValueParams extends BaseWithValueColDefParams {
data: GeneralListItem;
}
interface GenValueGetterParams extends ValueGetterParams {
data: GeneralListItem;
}
interface GenColDef extends ColDef {
field?: headerType; field?: headerType;
}; valueFormatter?: string | ((params: GenValueParams) => string);
filterValueGetter?: string | ((params: GenValueGetterParams) => string);
}
interface GenColGroupDef extends ColGroupDef {
children: (GenColDef | GenColGroupDef)[];
groupId: headerType;
}
interface GenCellClassParams extends CellClassParams { interface GenCellClassParams extends CellClassParams {
data: GeneralListItem; data: GeneralListItem;
} }
function naiveCheClassNameFilter(value: string): string {
const text = value.split("_").pop() ?? "None";
if (text === "None") {
return "-";
}
return text;
}
function naiveCheClassNameFilterFromRow(key: keyof GeneralListItem) {
return (value: GenValueParams): string => {
return naiveCheClassNameFilter(value.data[key]?.toString() ?? "None");
};
}
function numberFormatter(value: GenValueParams): string {
return (value.value as number).toLocaleString();
}
const defaultCellClass = ["cell-middle"];
const centerCellClass = [...defaultCellClass, "cell-center"];
const rightAlignClass = [...defaultCellClass, "cell-right"];
const sortableNumber: GenColDef = {
sortable: true,
comparator: (a, b) => a - b,
sortingOrder: ["desc", "asc", null],
filter: "number",
cellClass: rightAlignClass,
};
const defaultColDef = ref<ColDef>({ const defaultColDef = ref<ColDef>({
resizable: true, resizable: true,
headerClass: "default-cell-header", headerClass: "default-cell-header",
cellClass: "cell-middle", cellClass: centerCellClass,
floatingFilter: true,
width: 90,
}); });
const sortableNumber: GenColDef = { const columnRawDefs = ref<Partial<Record<headerType, GenColDef | GenColGroupDef>>>({
sortable: true,
comparator: (a, b)=>a-b,
sortingOrder: ['desc', 'asc', null],
filter: 'number'
}
const columnRawDefs = ref<Partial<Record<headerType, GenColDef>>>({
icon: { icon: {
headerName: "아이콘", headerName: "아이콘",
width: 64 + 24, width: 64 + 24,
suppressSizeToFit: true, suppressSizeToFit: true,
resizable: false, resizable: false,
cellRenderer: (obj: { data: GeneralListItem }) => { cellRenderer: (obj: GenValueParams) => {
const { data: gen } = obj; const { data: gen } = obj;
return `<img src="${getIconPath(gen.imgsvr, gen.picture)}" width="64">`; return `<img src="${getIconPath(gen.imgsvr, gen.picture)}" width="64">`;
}, },
@@ -144,7 +193,8 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef>>>({
field: "name", field: "name",
pinned: "left", pinned: "left",
sortable: true, sortable: true,
sortingOrder: ['asc', 'desc', null], width: 130,
sortingOrder: ["asc", "desc", null],
lockPosition: true, lockPosition: true,
cellStyle: (val: GenCellClassParams) => { cellStyle: (val: GenCellClassParams) => {
const gen = val.data; const gen = val.data;
@@ -153,117 +203,229 @@ const columnRawDefs = ref<Partial<Record<headerType, GenColDef>>>({
}; };
return style as CellStyle; return style as CellStyle;
}, },
cellClass: defaultCellClass,
filter: true, filter: true,
}, },
npc: { headerName: "NPC", field: "npc", hide: true }, npc: { headerName: "NPC", field: "npc", hide: true },
leadership: { headerName: '통솔', field: 'leadership', ...sortableNumber}, stat: {
strength: { headerName: '무력', field: 'strength', ...sortableNumber}, groupId: "stat",
intel: { headerName: '지력', field: 'intel', ...sortableNumber}, openByDefault: false,
explevel: { headerName: '명성Lv', field: 'explevel', ...sortableNumber}, headerName: "능력치",
dedlevel: { headerName: '계급Lv', field: 'dedlevel', ...sortableNumber}, children: [
{
headerName: "통|무|지",
width: 90,
cellRenderer: (obj: GenValueParams) => {
const gen = obj.data;
return `${gen.leadership}|${gen.strength}|${gen.intel}`;
},
columnGroupShow: "closed",
},
{
headerName: "통솔",
field: "leadership",
...sortableNumber,
columnGroupShow: "open",
width: 70,
type: "numericColumn",
},
{
headerName: "무력",
field: "strength",
...sortableNumber,
columnGroupShow: "open",
width: 70,
},
{
headerName: "지력",
field: "intel",
...sortableNumber,
columnGroupShow: "open",
width: 70,
},
],
},
officerLevel: {
headerName: "관직",
field: "officerLevelText",
sortable: true,
comparator: (a, b, c, d) => c.data.officerLevel - d.data.officerLevel,
cellRenderer: ({ data }: GenValueParams) => {
if (data.permission == 2 && 2 <= data.officerLevel && 4 <= data.officerLevel) {
return `${data.officer_city} ${data.officerLevelText}`;
}
return data.officerLevelText;
},
filter: true,
cellClass: centerCellClass,
width: 90,
},
expDedLv: {
headerName: "명성",
groupId: "expDedLv",
width: 70,
children: [
{
headerName: "/계급",
columnGroupShow: "closed",
width: 70,
cellRenderer: ({ data }: GenValueParams) => {
return `Lv ${data.explevel}<br>${data.dedLevelText}`;
},
},
{
headerName: "명성",
field: "explevel",
width: 75,
cellRenderer: ({ data }: GenValueParams) => {
return `Lv ${data.explevel}<br>(${data.honorText})`;
},
...sortableNumber,
columnGroupShow: "open",
},
{
headerName: "계급",
field: "dedLevelText",
width: 75,
cellRenderer: ({ data }: GenValueParams) => {
return `${data.dedLevelText}<br>(${data.bill.toLocaleString()})`;
},
...sortableNumber,
cellClass: centerCellClass,
columnGroupShow: "open",
},
],
},
gold: { headerName: "금", field: "gold", ...sortableNumber, valueFormatter: numberFormatter, width: 75 },
rice: { headerName: "쌀", field: "rice", ...sortableNumber, valueFormatter: numberFormatter, width: 75 },
specials: {
headerName: "성격/내특/전특",
children: [
{
headerName: "요약",
cellRenderer: ({ data }: GenValueParams) => {
const personal = naiveCheClassNameFilter(data.personal);
const specialDomestic = naiveCheClassNameFilter(data.specialDomestic);
const specialWar = naiveCheClassNameFilter(data.specialWar);
return `${personal}<br><div class="row gx-1 m-0 cell-sp"><div class="col">${specialDomestic}</div><div class="col">${specialWar}</div>`;
},
width: 90,
columnGroupShow: "closed",
},
{
headerName: "성격",
field: "personal",
valueFormatter: naiveCheClassNameFilterFromRow("personal"),
width: 70,
sortable: true,
filter: true,
columnGroupShow: "open",
},
{
headerName: "내특",
field: "specialDomestic",
valueFormatter: naiveCheClassNameFilterFromRow("specialDomestic"),
width: 70,
sortable: true,
filter: true,
columnGroupShow: "open",
},
{
headerName: "전특",
field: "specialWar",
valueFormatter: naiveCheClassNameFilterFromRow("specialWar"),
width: 70,
sortable: true,
filter: true,
columnGroupShow: "open",
},
],
},
years: {
headerName: "연도",
children: [
{
headerName: "요약",
cellRenderer: ({ data }: GenValueParams) => {
return `${data.age}세<br>${data.belong}`;
},
cellClass: centerCellClass,
columnGroupShow: "closed",
},
{
headerName: "연령",
field: "age",
...sortableNumber,
valueFormatter: (v: GenValueParams) => `${v.value}`,
width: 70,
cellClass: centerCellClass,
columnGroupShow: "open",
},
{
headerName: "사관",
field: "belong",
...sortableNumber,
valueFormatter: (v: GenValueParams) => `${v.value}`,
width: 70,
cellClass: centerCellClass,
columnGroupShow: "open",
},
],
},
killturnAndConnect: {
headerName: "기타",
children: [
{
headerName: "삭/벌",
cellRenderer: ({ data }: GenValueParams) => {
return `${data.killturn.toLocaleString()}턴<br>${data.connect.toLocaleString()}`;
},
cellClass: rightAlignClass,
columnGroupShow: "closed",
},
{
headerName: "삭턴",
field: "killturn",
cellRenderer: ({ data }: GenValueParams) => {
return `${data.killturn.toLocaleString()}`;
},
...sortableNumber,
columnGroupShow: "open",
},
{
headerName: "벌점",
field: "connect",
cellRenderer: ({ data }: GenValueParams) => {
return `${data.connect.toLocaleString()}`;
},
...sortableNumber,
columnGroupShow: "open",
},
],
},
}); });
const columnDefs = ref([...Object.values(columnRawDefs.value)]); const columnDefs = ref([...Object.values(columnRawDefs.value)]);
const headerMap: Record<headerType, headerInfo> = {
icon: {
title: "아이콘",
type: "display",
style: {
maxWidth: "64px",
},
converter: (gen) => {
return `<img src="${getIconPath(gen.imgsvr, gen.picture)}" width="64">`;
},
},
name: { title: "장수명", searchable: true },
nation: { title: "국가명", isEnum: true },
npc: { title: "NPC", isEnum: true, type: "filter" },
injury: { title: "부상", sortable: "asc" },
leadership: { title: "통솔" },
strength: { title: "무력" },
intel: { title: "지력" },
stat: {
title: "통/무/지",
type: "custom",
subType: {
leadership: { title: "통" },
strength: { title: "무" },
intel: { title: "지" },
},
},
explevel: { title: "명성Lv" },
dedlevel: { title: "계급Lv" },
expDedLv: {
title: "명성/계급Lv",
subType: {
explevel: { title: "명성Lv" },
dedlevel: { title: "계급Lv" },
},
},
gold: { title: "금", sortable: "desc" },
rice: { title: "쌀", sortable: "desc" },
goldRice: {
title: "금/쌀",
type: "custom",
subType: {
gold: { title: "금", sortable: "desc" },
rice: { title: "쌀", sortable: "desc" },
},
},
age: { title: "연령" },
specialDomestic: { title: "내특" },
specialWar: { title: "전특" },
specials: {
title: "성격/내특/전특",
subType: {
personal: { title: "성격", converter: (g) => g.personal.split("_").pop() as string },
specialDomestic: { title: "내특", converter: (g) => g.specialDomestic.split("_").pop() as string },
specialWar: { title: "전특", converter: (g) => g.specialWar.split("_").pop() as string },
},
},
personal: { title: "성격" },
belong: { title: "임관" },
killturnAndConnect: {
title: "삭턴/벌점",
subType: {
killturn: { title: "삭턴" },
connect: { title: "벌점" },
},
},
killturn: { title: "삭턴" },
connect: { title: "벌점" },
officerLevel: { title: "관직" }, //권한에따라 태수,군사,시종 노출 여부가 다름
ownerName: { title: "소유주" }, //NPC 출력용에 따라 결과가 다름
honorText: { title: "명성" },
city: { title: "도시" },
experience: { title: "명성" },
dedication: { title: "계급" },
officer_level: { title: "관직" },
officer_city: { title: "부임지" },
} as const;
watch(columnRawDefs, (val) => { watch(columnRawDefs, (val) => {
setRowHeight(); setRowHeight();
columnDefs.value = [...Object.values(val)]; columnDefs.value = [...Object.values(val)];
}); });
/*
let currentWidth = -1; let currentWidth = -1;
window.addEventListener("resize", (e) => { window.addEventListener("resize", (e) => {
setTimeout(() => { setTimeout(() => {
const newWidth = document.querySelector(".container")?.clientWidth ?? -1; const newWidth = document.querySelector(".container")?.clientWidth ?? -1;
if (currentWidth != newWidth) { if (currentWidth != newWidth) {
currentWidth = newWidth; currentWidth = newWidth;
gridApi.value?.sizeColumnsToFit(); columnApi.value?.autoSizeAllColumns();
} }
}, 1); }, 1);
}); });
*/
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@@ -291,14 +453,28 @@ window.addEventListener("resize", (e) => {
overflow: auto; overflow: auto;
} }
.ag-root{ .ag-root {
overflow: auto; overflow: auto;
} }
.ag-header{ .ag-header {
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 10; z-index: 10;
} }
.cell-center {
justify-content: space-around;
text-align: center;
}
.cell-right {
justify-content: flex-end;
text-align: right;
}
.cell-sp .col {
min-width: 30px;
}
} }
</style> </style>
+77 -3
View File
@@ -1,5 +1,79 @@
import type { ValidResponse } from "@/defs"; import type { ValuesOf, TurnObj } from "@/defs";
import type { GameObjClassKey } from "@/defs/GameObj";
import type { ValidResponse } from "@/SammoAPI";
export type SetBlockWarResponse = ValidResponse & { export type SetBlockWarResponse = ValidResponse & {
availableCnt: number; availableCnt: number;
}; };
export type GeneralListItemP0 = {
no: number,
name: string,
nation: number,
npc: number,
injury: number,
leadership: number,
strength: number,
intel: number,
explevel: number,
dedlevel: number,
gold: number,
rice: number,
killturn: number,
picture: string,
imgsvr: 0 | 1,
age: number,
specialDomestic: GameObjClassKey,
specialWar: GameObjClassKey,
personal: GameObjClassKey,
belong: number,
connect: number,
officerLevel: number, //권한에따라 태수,군사,시종 노출 여부가 다름
officerLevelText: string,
lbonus: number,
ownerName: string | null, //NPC 출력용에 따라 결과가 다름
honorText: string,
dedLevelText: string,
bill: number,
}
export type GeneralListItemP1 = {
city: number,
experience: number,
dedication: number,
} & GeneralListItemP0;
export type GeneralListItemP2 = GeneralListItemP1 & {
officer_level: number,
officer_city: number,
}
export type RawGeneralListItem = GeneralListItemP0 | GeneralListItemP1 | GeneralListItemP2;
export type GeneralListItem =
({ permission: 0 } & GeneralListItemP0) |
({ permission: 1 } & GeneralListItemP1) |
({ permission: 2 | 3 | 4 } & GeneralListItemP2);
export type RawGeneralListP0 = ValidResponse & {
permission: 0,
column: (keyof GeneralListItemP0)[],
list: ValuesOf<GeneralListItemP0>[][],
}
export type RawGeneralListP1 = ValidResponse & {
permission: 1,
column: (keyof GeneralListItemP1)[],
list: ValuesOf<GeneralListItemP1>[][],
}
export type RawGeneralListP2 = ValidResponse & {
permission: 2 | 3 | 4,
column: (keyof GeneralListItemP2)[],
list: ValuesOf<GeneralListItemP2>[][],
}
export type GeneralListResponse = RawGeneralListP0 | RawGeneralListP1 | RawGeneralListP2;
-73
View File
@@ -1,73 +0,0 @@
import type { GameObjType, ValuesOf } from "@/defs";
import type { ValidResponse } from "@/SammoAPI";
export type GeneralListItemP0 = {
no: number,
name: string,
nation: number,
npc: number,
injury: number,
leadership: number,
strength: number,
intel: number,
explevel: number,
dedlevel: number,
gold: number,
rice: number,
killturn: number,
picture: string,
imgsvr: 0 | 1,
age: number,
specialDomestic: GameObjType,
specialWar: GameObjType,
personal: GameObjType,
belong: number,
connect: number,
officerLevel: number, //권한에따라 태수,군사,시종 노출 여부가 다름
officerLevelText: string,
lbonus: number,
ownerName: string | null, //NPC 출력용에 따라 결과가 다름
honorText: string,
}
export type GeneralListItemP1 = {
city: number,
experience: number,
dedication: number,
} & GeneralListItemP0;
export type GeneralListItemP2 = GeneralListItemP1 & {
officer_level: number,
officer_city: number,
}
export type RawGeneralListItem = GeneralListItemP0 | GeneralListItemP1 | GeneralListItemP2;
export type GeneralListItem =
({ permission: 0 } & GeneralListItemP0) |
({ permission: 1 } & GeneralListItemP1) |
({ permission: 2 | 3 | 4 } & GeneralListItemP2);
export type RawGeneralListP0 = ValidResponse & {
permission: 0,
column: (keyof GeneralListItemP0)[],
list: ValuesOf<GeneralListItemP0>[][],
}
export type RawGeneralListP1 = ValidResponse & {
permission: 1,
column: (keyof GeneralListItemP1)[],
list: ValuesOf<GeneralListItemP1>[][],
}
export type RawGeneralListP2 = ValidResponse & {
permission: 2 | 3 | 4,
column: (keyof GeneralListItemP2)[],
list: ValuesOf<GeneralListItemP2>[][],
}
export type GeneralListResponse = RawGeneralListP0 | RawGeneralListP1 | RawGeneralListP2;