feat: 寻路系统接线

This commit is contained in:
unanmed 2026-09-15 21:28:52 +08:00
parent 2ba3089c9a
commit 1ff22dd07d
2 changed files with 13 additions and 6 deletions

View File

@ -1 +1 @@
{"isolation":"none","harness_flag":null,"phase":"06","plan":null,"written_at":1789346124877} {"isolation":"none","harness_flag":null,"phase":"7","plan":null,"written_at":1789461142586}

View File

@ -81,7 +81,7 @@ import {
TileLegacyBridge TileLegacyBridge
} from './legacy'; } from './legacy';
import { isNil } from 'lodash-es'; import { isNil } from 'lodash-es';
import { DefaultHeroMoveTopImpl } from './hero'; import { DefaultHeroMoveTopImpl, DefaultPassPredicateImpl } from './hero';
import { createEventRegistrations } from './event/registrations'; import { createEventRegistrations } from './event/registrations';
import { import {
ReplayEquipCommand, ReplayEquipCommand,
@ -229,6 +229,17 @@ export class CoreState implements ICoreState {
// 录像系统 // 录像系统
this.replaySystem = new ReplaySystem(); this.replaySystem = new ReplaySystem();
// 寻路系统
const pathfinding = new PathfindingSystem(this);
this.pathfinding = pathfinding;
pathfinding.useMover(this.hero.location.mover);
pathfinding.finder.useMapState(this.maps);
// 初始状态下勇士不在任何楼层,切换楼层后再具体设置
pathfinding.finder.useMapLayer(null);
pathfinding.finder.usePassPredicate(
new DefaultPassPredicateImpl(this.maps)
);
//#endregion //#endregion
//#region L3 初始化 //#region L3 初始化
@ -259,10 +270,6 @@ export class CoreState implements ICoreState {
const heroMoveTopImpl = new DefaultHeroMoveTopImpl(this); const heroMoveTopImpl = new DefaultHeroMoveTopImpl(this);
this.hero.location.mover.useTopImplementation(heroMoveTopImpl); this.hero.location.mover.useTopImplementation(heroMoveTopImpl);
const pathfinding = new PathfindingSystem(this);
pathfinding.useMover(this.hero.location.mover);
this.pathfinding = pathfinding;
// 录像系统初始化注册 // 录像系统初始化注册
this.registerReplayCommands(); this.registerReplayCommands();