feat(fsm): 添加有限状态机模块 (#327)

- 添加 IStateMachine 接口,支持泛型状态和上下文
- 添加 StateMachine 实现
- 支持状态定义 (onEnter/onExit/onUpdate)
- 支持转换定义和条件
- 支持事件监听 (onChange/onEnter/onExit)
- 添加 8 个蓝图节点:
  - GetCurrentState, TransitionTo, CanTransition
  - IsInState, WasInState, GetStateDuration
  - EvaluateTransitions, ResetStateMachine
This commit is contained in:
YHH
2025-12-25 12:51:52 +08:00
committed by GitHub
parent 0bf849e193
commit 840eb3452e
12 changed files with 1550 additions and 0 deletions

28
pnpm-lock.yaml generated
View File

@@ -1028,6 +1028,34 @@ importers:
specifier: ^5.3.3
version: 5.9.3
packages/fsm:
dependencies:
tslib:
specifier: ^2.8.1
version: 2.8.1
devDependencies:
'@esengine/blueprint':
specifier: workspace:*
version: link:../blueprint
'@esengine/build-config':
specifier: workspace:*
version: link:../build-config
'@esengine/ecs-framework':
specifier: workspace:*
version: link:../core
'@types/node':
specifier: ^20.19.17
version: 20.19.25
rimraf:
specifier: ^5.0.0
version: 5.0.10
tsup:
specifier: ^8.0.0
version: 8.5.1(@microsoft/api-extractor@7.55.1(@types/node@20.19.25))(@swc/core@1.15.3)(jiti@2.6.1)(postcss@8.5.6)(tsx@4.21.0)(typescript@5.9.3)(yaml@2.8.1)
typescript:
specifier: ^5.8.3
version: 5.9.3
packages/material-editor:
dependencies:
'@esengine/material-system':