NodeLibraryclass
Contains a library of `Facepunch.ActionGraphs.NodeDefinition`s, each with a unique identifier. Custom node definitions can be added with `Facepunch.ActionGraphs.NodeLibrary.Add(Facepunch.ActionGraphs.NodeDefinition)`, or from methods marked with either `!:ActionNodeAttribute` or `!:ExpressionNodeAttribute` when using `Facepunch.ActionGraphs.NodeLibrary.AddAssembly(System.Reflection.Assembly)`.
Constructors1
Showing 1 constructors
public NodeLibrary(Facepunch.ActionGraphs.ITypeLoader typeLoader, Facepunch.ActionGraphs.IGraphLoader graphLoader = null)
Contains a library of `Facepunch.ActionGraphs.NodeDefinition`s, each with a unique identifier. An `Facepunch.ActionGraphs.ITypeLoader` is required to wrap reflection methods. Use an `Facepunch.ActionGraphs.DefaultTypeLoader` if no access control is needed.
| Parameter | Type | Description |
|---|---|---|
| typeLoader | ITypeLoader | — |
| graphLoader = null | IGraphLoader | — |
No results match this filter.
Methods17
Showing 17 methods
public void Add(Facepunch.ActionGraphs.NodeDefinition definition)
Add a custom node definition. The `Facepunch.ActionGraphs.NodeDefinition.Identifier` must be unique in this library. See also `Facepunch.ActionGraphs.NodeLibrary.AddAssembly(System.Reflection.Assembly)` for an easier way to implement custom nodes.
| Parameter | Type | Description |
|---|---|---|
| definition | NodeDefinition | Custom node definition to add. |
void—public Facepunch.ActionGraphs.AddAssemblyResult AddAssembly(System.Reflection.Assembly asm)
Adds a node definition for each method annotated with either `!:ActionNodeAttribute` or `Facepunch.ActionGraphs.ExpressionNodeDefinition` in the given assembly.
| Parameter | Type | Description |
|---|---|---|
| asm | Assembly | — |
public void ClearReflectionCache()
void—public void InvalidateDefaultBindings()
void—public bool IsProperty(System.Reflection.ParameterInfo parameter)
Returns true if the given parameter should be a property on a node, rather than an input or output.
| Parameter | Type | Description |
|---|---|---|
| parameter | ParameterInfo | Parameter to test. |
bool—public bool IsPure(System.Reflection.MethodBase method)
Returns true if the given method has been marked as pure. Pure methods have no (visible) side effects, and so can be turned into expression nodes.
| Parameter | Type | Description |
|---|---|---|
| method | MethodBase | Method to test. |
bool—public bool IsTarget(System.Reflection.ParameterInfo parameter)
| Parameter | Type | Description |
|---|---|---|
| parameter | ParameterInfo | — |
bool—public bool RemoveAssembly(System.Reflection.Assembly assembly)
| Parameter | Type | Description |
|---|---|---|
| assembly | Assembly | — |
bool—public void Reset()
Removes all custom node definitions from this library.
void—No results match this filter.
Properties14
Showing 14 properties
public System.Collections.Generic.IReadOnlyDictionary`2<string,Facepunch.ActionGraphs.NodeDefinition> Facepunch.ActionGraphs.NodeLibrary.All { get; set; }
Dictionary of all added definitions, indexed by their `Facepunch.ActionGraphs.NodeDefinition.Identifier`s.
public Facepunch.ActionGraphs.NodeDefinition Facepunch.ActionGraphs.NodeLibrary.CallMethod { get; set; }
Node definition for calling a named method.
public Facepunch.ActionGraphs.NodeDefinition Facepunch.ActionGraphs.NodeLibrary.Comment { get; set; }
A node with no inputs or outputs, only metadata. Useful for holding documentation.
public Facepunch.ActionGraphs.NodeDefinition Facepunch.ActionGraphs.NodeLibrary.Constant { get; set; }
Node definition for providing constant values.
public Facepunch.ActionGraphs.NodeDefinition Facepunch.ActionGraphs.NodeLibrary.Graph { get; set; }
A node implemented by an action graph.
public Facepunch.ActionGraphs.IGraphLoader Facepunch.ActionGraphs.NodeLibrary.GraphLoader { get; set; }
public Facepunch.ActionGraphs.NodeDefinition Facepunch.ActionGraphs.NodeLibrary.Input { get; set; }
Node definition for the entry point of the graph. Each graph can only have one such entry point.
public Facepunch.ActionGraphs.NodeDefinition Facepunch.ActionGraphs.NodeLibrary.InputValue { get; set; }
Helper node for accessing a graph input parameter.
public Facepunch.ActionGraphs.NodeDefinition Facepunch.ActionGraphs.NodeLibrary.NewInstance { get; set; }
Node definition for calling a constructor to create an instance.
public Facepunch.ActionGraphs.NodeDefinition Facepunch.ActionGraphs.NodeLibrary.NoOperation { get; set; }
A node that does nothing, just forwards an input to its output.
public Facepunch.ActionGraphs.NodeDefinition Facepunch.ActionGraphs.NodeLibrary.Output { get; set; }
Node definition for output signals of the graph. Each graph can have at most one primary output.
public Facepunch.ActionGraphs.NodeDefinition Facepunch.ActionGraphs.NodeLibrary.Property { get; set; }
Node definition for getting or setting static or instance properties.
public Facepunch.ActionGraphs.ITypeLoader Facepunch.ActionGraphs.NodeLibrary.TypeLoader { get; set; }
public Facepunch.ActionGraphs.NodeDefinition Facepunch.ActionGraphs.NodeLibrary.Variable { get; set; }
Node definition for getting or setting `Facepunch.ActionGraphs.NodeLibrary.Variable` values.
No results match this filter.