From 25b87669cef51d461a2b298544ace1f04cca3cc2 Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Sat, 31 Dec 2022 22:45:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=8A=80=E8=83=BD=E6=A0=91ui?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugin/ui/fly.ts | 32 +++++++++++++++++++++++++++++--- src/ui/skillTree.vue | 16 +++++++++++----- 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/src/plugin/ui/fly.ts b/src/plugin/ui/fly.ts index 6f13864..dc93956 100644 --- a/src/plugin/ui/fly.ts +++ b/src/plugin/ui/fly.ts @@ -2,8 +2,34 @@ export default function init() { return { splitArea }; } -function splitArea() {} +interface MapBFSResult { + maps: FloorIds[]; + link: Record< + `${FloorIds}_${number}_${number}_${Dir}`, + `${FloorIds}_${number}_${number}` + >; +} -function getMapData(floorId: FloorIds) {} +const bfsCache: Partial> = {}; -function bfs(floorId: FloorIds) {} +export function splitArea() {} + +export function getMapData(floorId: FloorIds) {} + +export function getMapDrawData(floorId: FloorIds) {} + +/** + * 广度优先搜索地图信息 + * @param floorId 中心楼层id + * @param noCache 是否不使用缓存 + */ +function bfs(floorId: FloorIds, noCache: boolean = false) { + if (bfsCache[floorId] && !noCache) return bfsCache[floorId]; + + const queue = [floorId]; + const used: Partial> = {}; + + while (queue.length > 0) { + const now = queue.shift()!; + } +} diff --git a/src/ui/skillTree.vue b/src/ui/skillTree.vue index a037252..59c75e5 100644 --- a/src/ui/skillTree.vue +++ b/src/ui/skillTree.vue @@ -30,6 +30,8 @@ id="divider-vertical" >
+ 当前等级:{{ level }} +