Class CeresGraph
public class CeresGraph : IDisposable, IDisposableUnregister
- Inheritance
-
objectCeresGraph
- Implements
-
IDisposableUnregister
- Derived
Constructors
CeresGraph()
public CeresGraph()
CeresGraph(CeresGraphData)
public CeresGraph(CeresGraphData graphData)
Parameters
graphDataCeresGraphData
Fields
nodes
public List<CeresNode> nodes
Field Value
- List<CeresNode>
SubGraphSlots
public CeresSubGraphSlot[] SubGraphSlots
Field Value
variables
public List<SharedVariable> variables
Field Value
- List<SharedVariable>
Properties
Blackboard
Exposed blackboard for data exchange
public Blackboard Blackboard { get; }
Property Value
Methods
AddSubGraphSlot<TGraph>(CeresSubGraphSlot)
Try to add a subGraph slot with specific type validation
public bool AddSubGraphSlot<TGraph>(CeresSubGraphSlot slot) where TGraph : CeresGraph
Parameters
slotCeresSubGraphSlot
Returns
- bool
Type Parameters
TGraph
CollectDependencyPath(CeresGraph)
protected static void CollectDependencyPath(CeresGraph graph)
Parameters
graphCeresGraph
Compile(CeresGraphCompiler)
Compile graph just in time
public virtual void Compile(CeresGraphCompiler compiler)
Parameters
compilerCeresGraphCompilerRuntime compiler
CompileNodes(CeresGraphCompiler)
protected static void CompileNodes(CeresGraphCompiler compiler)
Parameters
compilerCeresGraphCompiler
CreateBlackboard(List<SharedVariable>)
Create a blackboard from provided variables
protected virtual Blackboard CreateBlackboard(List<SharedVariable> inVariables)
Parameters
inVariablesList<SharedVariable>
Returns
Dispose()
public virtual void Dispose()
FindNode(string)
Find node by guid
public CeresNode FindNode(string guid)
Parameters
guidstring
Returns
- CeresNode
Null if not exist
FindNode<TNode>(string)
Find node with specific type by guid
public TNode FindNode<TNode>(string guid) where TNode : CeresNode
Parameters
guidstring
Returns
- TNode
Null if not exist
Type Parameters
TNode
FindSubGraph<TGraph>(string)
Find subGraph with specific type by name
public TGraph FindSubGraph<TGraph>(string name) where TGraph : CeresGraph
Parameters
namestring
Returns
- TGraph
Null if not exist
Type Parameters
TGraph
GetDependencyPaths()
Get graph node current dependency path if existed
public int[][] GetDependencyPaths()
Returns
- int[][]
GetFirstNodeOfType<TNode>()
Get first node with specific type
public TNode GetFirstNodeOfType<TNode>() where TNode : CeresNode
Returns
- TNode
Null if not exist
Type Parameters
TNode
GetNodeDependencyPath(CeresNode)
Get dependency execution path for destination node
public int[] GetNodeDependencyPath(CeresNode node)
Parameters
nodeCeresNode
Returns
- int[]
GetNodeDependencyPath(string)
Get dependency execution path for destination node with guid
public int[] GetNodeDependencyPath(string guid)
Parameters
guidstring
Returns
- int[]
InitPorts(CeresGraph)
Traverse the graph and init all ports automatically
protected static void InitPorts(CeresGraph graph)
Parameters
graphCeresGraph
InitVariables(CeresGraph)
Traverse the graph and init all shared variables automatically
protected static void InitVariables(CeresGraph graph)
Parameters
graphCeresGraph
IsUberGraph()
Is graph on top level which means it can have subGraphs
public virtual bool IsUberGraph()
Returns
- bool
LinkPort(CeresPort, CeresNode, CeresPortData)
protected virtual void LinkPort(CeresPort port, CeresNode ownerNode, CeresPortData portData)
Parameters
portCeresPortownerNodeCeresNodeportDataCeresPortData
SetCompilerTarget(CeresGraphCompiler)
protected void SetCompilerTarget(CeresGraphCompiler compiler)
Parameters
compilerCeresGraphCompiler
SetDependencyPath(int[][])
Set graph node pre-cached dependency path
public void SetDependencyPath(int[][] dependencyPath)
Parameters
dependencyPathint[][]
TopologicalSort(CeresGraph, List<CeresNode>)
protected static int[][] TopologicalSort(CeresGraph graph, List<CeresNode> nodes)
Parameters
graphCeresGraphnodesList<CeresNode>
Returns
- int[][]