元編程參考文件

狀態機

7 個節點

本頁內容 7

狀態機

函數

此節點沒有文件說明。

簽名
狀態機() -> State Machine
StateMachineApplication StateMachineApplication()

返回

狀態機State Machine
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
狀態機
所屬包
狀態機

新增轉換

函數

Declares one transition. A null Condition is an UNCONDITIONAL transition: it is
satisfied on every evaluation, so the machine leaves From State after its next
Update returns (subject to priority - an unconditional low-priority transition is a fallback edge).
That is the recorded phase-3 decision for a transition whose payload names no condition graph: an
edge the author drew means something, and "always" is the natural meaning of an unguarded one.

簽名
新增轉換
    State Machine: State Machine
    源狀態: 文字
    目標狀態: 文字
    轉換名稱: 文字
    條件: Func<真否>
    優先順序: 整數
void AddTransition(
    StateMachineApplication State Machine,
    string fromState,
    string toState,
    string transitionName,
    Func<bool> condition,
    int priority)

參數

名稱型別預設值說明
State MachineState Machine—
源狀態文字—The state this transition leaves.
目標狀態文字—The state this transition enters (may equal From State - a self-transition).
轉換名稱文字—The authored display name, or null for an unnamed transition.
條件Func<真否>—Whether the transition fires, asked after each Update; null = always.
優先順序整數—Higher evaluates first; see StateMachineApplication.OutgoingOf for the tie rule.
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
狀態機
所屬包
狀態機

狀態機名稱

函數

What failure messages call this machine: the graph's name interpreted, set by the emitted
constructor compiled; the emitted type's name failing both.

簽名
狀態機名稱(State Machine: State Machine) -> 文字
string MachineName(StateMachineApplication State Machine)

參數

名稱型別預設值說明
State MachineState Machine—

返回

結果文字
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
狀態機
所屬包
狀態機

已請求停止

函數

Whether StateMachineApplication.Stop has been called for the current run.

簽名
已請求停止(State Machine: State Machine) -> 真否
bool StopRequested(StateMachineApplication State Machine)

參數

名稱型別預設值說明
State MachineState Machine—

返回

結果真否
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
狀態機
所屬包
狀態機

節拍排程器

函數

The tick scheduler the loop runs on; null (the default) means real time
(StateMachine.RealTimeTickScheduler). Settable so a test - or any host that owns time - can drive
the machine deterministically; this is the machine analogue of the recording-driver pattern.

簽名
節拍排程器(State Machine: State Machine) -> I State Machine Tick Scheduler
IStateMachineTickScheduler TickScheduler(StateMachineApplication State Machine)

參數

名稱型別預設值說明
State MachineState Machine—

返回

結果I State Machine Tick Scheduler
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
資料流 函數 事件 例程 藍圖 狀態機狀態
宣告於
狀態機
所屬包
狀態機

註冊狀態

函數

Declares one state: its name (the state graph's name), how to construct a FRESH instance of it -
entering a state always constructs anew, self-transitions included - and whether it is the initial
state.

簽名
註冊狀態
    State Machine: State Machine
    狀態名稱: 文字
    工廠: Func<State Machine State>
    初始狀態: 真否
void RegisterState(
    StateMachineApplication State Machine,
    string stateName,
    Func<StateMachineState> factory,
    bool isInitial = false)

參數

名稱型別預設值說明
State MachineState Machine—
狀態名稱文字—
工廠Func<State Machine State>—
初始狀態真否False
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
狀態機
所屬包
狀態機

停止

函數

Ends the machine from anywhere: the loop stops at its next checkpoint - after the callback (or
condition) that called this returns - without exiting the active state. Callable from a state
(through StateMachineState.Stop), from a condition, or from another thread.

簽名
停止(State Machine: State Machine)
void Stop(StateMachineApplication State Machine)

參數

名稱型別預設值說明
State MachineState Machine—
所屬發行版
元編程(教育版)元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
狀態機
所屬包
狀態機