Class NamedFunction<T>
Stores a delegate by name for use with a value-providing interface (IBool, IString, ISprite).
The function must be defined before the value property is accessed. To ensure compatibility with round-trip deserialization, it is advised to define the function from a Module or Tag's Load.
Inheritance
NamedFunction<T>
Assembly: ItemChanger.dll
Syntax
public class NamedFunction<T>
Type Parameters
Constructors
View Source
NamedFunction(string)
Declaration
public NamedFunction(string name)
Parameters
| Type |
Name |
Description |
| string |
name |
|
Properties
View Source
Name
Declaration
public string Name { get; }
Property Value
View Source
Value
Declaration
Property Value
Methods
View Source
Define(string, Func<T>)
Defines the named function, and returns a object which refers to it. Throws an exception if a function with the same name has already been defined.
Declaration
public static NamedFunction<T> Define(string name, Func<T> getter)
Parameters
Returns
View Source
Redefine(string, Func<T>)
Defines the named function, and returns a object which refers to it. Overwrites any function with the same name which has already been defined.
Declaration
public static NamedFunction<T> Redefine(string name, Func<T> getter)
Parameters
Returns
Extension Methods