pathfinding-state-machine

0.0.1 • Public • Published

自动寻路的状态机

用transition指明初始状态, 目的状态和对应的动作(action, 支持异步), 多个transtion形成图(graph), 可指定任意状态,用最短路径算法找出路径, 到达指定状态。

API

props

  • context
  • allStates

Methods

  • getState
  • canGoto
  • gotoState(go)
  • go
  • getChart

生命周期

Task

  • taskStart
  • taskChange
  • taskError
  • taskEnd

Action

  • beforeAction
  • before
  • afterAction
  • after
  • actionError

State

  • enterState
  • enter

Readme

Keywords

none

Package Sidebar

Install

npm i pathfinding-state-machine

Weekly Downloads

0

Version

0.0.1

License

ISC

Last publish

Collaborators

  • etoah