Navigation
API > API/Plugins > API/Plugins/StateGraph
Inheritance Hierarchy
- TSharedFromThis
- FNoncopyable
- FStateGraph
References
| Module | StateGraph |
| Header | /Engine/Plugins/Experimental/StateGraph/Source/StateGraph/Public/StateGraph.h |
| Include | #include "StateGraph.h" |
Syntax
class FStateGraph :
public TSharedFromThis< FStateGraph > ,
public FNoncopyable
Remarks
State graph class to run and manage nodes with.
Variables
| Type | Name | Description | |
|---|---|---|---|
| bool | bRunAgain | ||
| bool | bRunning | ||
| double | CompletedTime | ||
| FString | ConfigSectionName | ||
| FDelegateHandle | ConfigSectionsChangedDelegate | ||
| FString | ContextName | ||
| FName | Name | ||
| TMap< FName, FStateGraphNodeRef > | Nodes | ||
| FNodeStatusChanged | OnNodeStatusChanged | ||
| FStatusChanged | OnStatusChanged | ||
| double | StartTime | ||
| EStatus | Status | ||
| double | Timeout | ||
| FTSTicker::FDelegateHandle | TimeoutTicker |
Constructors
| Type | Name | Description | |
|---|---|---|---|
FStateGraph
(
FName InName, |
Destructors
| Type | Name | Description | |
|---|---|---|---|
~FStateGraph () |
Functions
| Type | Name | Description | |
|---|---|---|---|
| bool | AddDependencies
(
FName NodeName, |
Helper function for adding dependencies to a node. | |
| bool | AddNode
(
const FStateGraphNodeRef& Node |
Add a node to the state graph. | |
| TEnableIf< TIsClass< ObjectType >::Value &&TIsInvocable< FunctionType, FStateGraph &, FStateGraphNod... | CreateNode
(
FName NodeName, |
Create a new function node for lambdas tied to objects. | |
| TEnableIf< TIsClass< ObjectType >::Value &&TIsInvocable< FunctionType, ObjectType, FStateGraph &, FS... | CreateNode
(
FName NodeName, |
Create a new function node for member functions. | |
| TEnableIf< TIsInvocable< FunctionType, FStateGraph &, FStateGraphNodeFunctionComplete, ArgsTypes... ... | CreateNode
(
FName NodeName, |
Create a new function node for lambas and static methods. | |
| TSharedRef< NodeType, ESPMode::ThreadSafe > | CreateNode
(
ArgsTypes&&... Args |
Create and add a new node for a given node class type. | |
| const FString & | |||
| double | GetDuration () |
Get duration of time that the state graph has taken to run. Returns 0 if not yet started. | |
| FName | GetName () |
Get the name of the state graph. | |
| TSharedPtr< NodeType, ESPMode::ThreadSafe > | Get a node from the state graph, casting to a derived type if needed. | ||
| FStateGraphNodeRef * | GetNodeRef
(
FName NodeName |
Get a node from the state graph. References should not be cached in case the node is destroyed. | |
| EStatus | GetStatus () |
Get the status of the state graph. | |
| const TCHAR * | GetStatusName
(
EStatus Status |
||
| const TCHAR * | Get the status of the state graph as a string. | ||
| double | GetTimeout () |
Get timeout in seconds. | |
| void | Initialize () |
Perform state graph initialization that could not run in constructor due to shared pointers not being ready, such as registering for hotfixes. | |
| void | LogDebugInfo
(
ELogVerbosity::Type Verbosity |
Log debug info for the state graph and each node. | |
| void | OnConfigSectionsChanged
(
const FString& IniFilename, |
Callback to update state graph and node configuration during hotfixes. | |
| void | Pause () |
Pause the state graph and prevent additional nodes from being started. | |
| void | Remove all nodes from the state graph that exist when this function is started. | ||
| bool | RemoveNode
(
FName NodeName |
Remove a node from the state graph. | |
| void | Reset () |
Stop and reset the state graph and all nodes. | |
| void | Run () |
Run the state graph. | |
| void | Set status and fire delegate if needed. | ||
| void | SetTimeout
(
double InTimeout |
Set timeout in seconds from the initial run call (when Status changes from NotStarted to Running) to when Status changes to Completed. | |
| void | UpdateConfig () |
Update config from INI files. Called from Initialize and during hotfixes. |
Enums
| Type | Name | Description | |
|---|---|---|---|
| EStatus |
Typedefs
| Name | Description |
|---|---|
| FNodeStatusChanged | Delegate fired when a node status changes. |
| FStatusChanged | Delegate fired when the state graph status changes. |