Navigation
API > API/Plugins > API/Plugins/StateGraph
State graph class to run and manage nodes with.
| Name | FStateGraph |
| Type | class |
| Header File | /Engine/Plugins/Experimental/StateGraph/Source/StateGraph/Public/StateGraph.h |
| Include Path | #include "StateGraph.h" |
Syntax
class FStateGraph :
public TSharedFromThis< FStateGraph >,
public FNoncopyable
Inheritance Hierarchy
- TSharedFromThis< FStateGraph > → FStateGraph
- FNoncopyable → FStateGraph
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FStateGraph
(
FName InName, |
StateGraph.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~FStateGraph() |
StateGraph.h |
Enums
Public
| Name | Remarks |
|---|---|
| EStatus |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FNodeStatusChanged | TMulticastDelegate_ThreeParams< void, FStateGraphNode &, FStateGraphNode::EStatus, FStateGraphNode::EStatus > | Delegate fired when a node status changes. | StateGraph.h |
| FStatusChanged | TMulticastDelegate_ThreeParams< void, FStateGraph &, EStatus, EStatus > | Delegate fired when the state graph status changes. | StateGraph.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| OnNodeStatusChanged | FNodeStatusChanged | StateGraph.h | ||
| OnStatusChanged | FStatusChanged | StateGraph.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool AddDependencies
(
FName NodeName, |
Helper function for adding dependencies to a node. | StateGraph.h | |
bool AddNode
(
const FStateGraphNodeRef& Node |
Add a node to the state graph. | StateGraph.h | |
TEnableIf< TIsClass< ObjectType >::Value &&TIsInvocable< FunctionType, ObjectType, FStateGraph &, FStateGraphNodeFunctionComplete, ArgsTypes... >::Value, FStateGraphNodeFunctionRef >::Type CreateNode
(
FName NodeName, |
Create a new function node for member functions. | StateGraph.h | |
TEnableIf< TIsClass< ObjectType >::Value &&TIsInvocable< FunctionType, FStateGraph &, FStateGraphNodeFunctionComplete, ArgsTypes... >::Value, FStateGraphNodeFunctionRef >::Type CreateNode
(
FName NodeName, |
Create a new function node for lambdas tied to objects. | StateGraph.h | |
TEnableIf< TIsInvocable< FunctionType, FStateGraph &, FStateGraphNodeFunctionComplete, ArgsTypes... >::Value, FStateGraphNodeFunctionRef >::Type CreateNode
(
FName NodeName, |
Create a new function node for lambas and static methods. | StateGraph.h | |
TSharedRef< NodeType, ESPMode::ThreadSafe > CreateNode
(
ArgsTypes&&... Args |
Create and add a new node for a given node class type. | StateGraph.h | |
FDateTime GetCompletedTime() |
StateGraph.h | ||
const FString & GetContextName() |
StateGraph.h | ||
double GetDuration() |
Get duration of time that the state graph has taken to run. Returns 0 if not yet started. | StateGraph.h | |
const FString & GetLogName() |
StateGraph.h | ||
FName GetName() |
Get the name of the state graph. | StateGraph.h | |
TSharedPtr< NodeType, ESPMode::ThreadSafe > GetNode
(
FName NodeName |
Get a node from the state graph, casting to a derived type if needed. | StateGraph.h | |
FStateGraphNodeRef * GetNodeRef
(
FName NodeName |
Get a node from the state graph. References should not be cached in case the node is destroyed. | StateGraph.h | |
TMap< FName, FStateGraphNodeRef > & GetNodes () |
Get map of all nodes in the state graph. | StateGraph.h | |
FDateTime GetStartTime() |
StateGraph.h | ||
EStatus GetStatus() |
Get the status of the state graph. | StateGraph.h | |
const TCHAR * GetStatusName () |
Get the status of the state graph as a string. | StateGraph.h | |
double GetTimeout() |
Get timeout in seconds. | StateGraph.h | |
void Initialize() |
Perform state graph initialization that could not run in constructor due to shared pointers not being ready, such as registering for hotfixes. | StateGraph.h | |
void LogDebugInfo
(
ELogVerbosity::Type Verbosity |
Log debug info for the state graph and each node. | StateGraph.h | |
void Pause () |
Pause the state graph and prevent additional nodes from being started. | StateGraph.h | |
void RemoveAllNodes () |
Remove all nodes from the state graph that exist when this function is started. | StateGraph.h | |
bool RemoveNode
(
FName NodeName |
Remove a node from the state graph. | StateGraph.h | |
void Reset() |
Stop and reset the state graph and all nodes. The state graph can be started again with Run(). | StateGraph.h | |
void Run () |
Run the state graph. | StateGraph.h | |
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. | StateGraph.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void OnConfigSectionsChanged
(
const FString& IniFilename, |
Callback to update state graph and node configuration during hotfixes. | StateGraph.h | |
void SetStatus
(
EStatus NewStatus |
Set status and fire delegate if needed. | StateGraph.h | |
void UpdateConfig() |
Update config from INI files. Called from Initialize and during hotfixes. | StateGraph.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static const TCHAR * GetStatusName
(
EStatus Status |
StateGraph.h | ||
static bool IsNoTimeouts() |
StateGraph.h |