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

Constructors

| Improve this Doc View Source

NamedFunction(String)

Declaration
public NamedFunction(string name)
Parameters
Type Name Description
System.String name

Properties

| Improve this Doc View Source

Name

Declaration
public string Name { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

Value

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

Methods

| Improve this Doc 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
System.String name
Func<T> getter
Returns
Type Description
NamedFunction<T>
| Improve this Doc 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
System.String name
Func<T> getter
Returns
Type Description
NamedFunction<T>

Extension Methods

Extensions.Yield<T>(T)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX