Show / Hide Table of Contents

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
object
NamedFunction<T>
NamedBoolFunction
NamedSpriteFunction
NamedStringFunction
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: ItemChanger
Assembly: ItemChanger.dll
Syntax
public class NamedFunction<T>
Type Parameters
Name Description
T

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
Type Description
string
View Source

Value

Declaration
public T Value { get; }
Property Value
Type Description
T

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
Type Name Description
string name
Func<T> getter
Returns
Type Description
NamedFunction<T>
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
Type Name Description
string name
Func<T> getter
Returns
Type Description
NamedFunction<T>

Extension Methods

Extensions.Yield<T>(T)
  • View Source
In this article
Back to top Generated by DocFX