FunctionType
A type that represents a function.
public class FunctionType : IType, IEquatable<IType>Inherits from System.Object
Implements Yarn.IType, System.IEquatable{Yarn.IType}
Functions have parameters and a return type, and can be called from scripts.
These can be created directly or via the Definitions file.
#Constructors
#FunctionType(IType, IType[])
Initialises a new instances of the FunctionType class.
public FunctionType(IType returnType, params IType[] parameterTypes)Parameters
returnTypeYarn.ITypeThe type of the value that this type of function returns.parameterTypesYarn.IType[]The types of the parameters that this type of function accepts.
#Properties
#Description
Gets a more verbose description of this type.
public string Description { get; set; }Type String
#Name
Gets the name of this type.
public string Name { get; }Type String
#Parameters
Gets the list of the parameter types that this function is
called with.
public List<IType> Parameters { get; internal set; }Type List
The length of this list also determines the number of
parameters this function accepts (also known as the function's
arity).
#Parent
#ReturnType
Gets the type of value that this function returns.
public IType ReturnType { get; internal set; }Type IType
#TypeMembers
Gets the collection of type information for this type's type members.
public IReadOnlyDictionary<string, ITypeMember> TypeMembers { get }Type IReadOnlyDictionary
#VariadicParameterType
Gets the type of value that this type of function accepts as a
variadic parameter.
public IType? VariadicParameterType { get; internal set; }Type IType
This value is
null if this type of
function does not accept variadic parameters.#Methods
#Equals(IType)
#GetParameterAt(int)
Gets the type of the parameter at the given index.
public IType GetParameterAt(int index)Parameters
indexintThe index of the parameter to get the type for.
Returns IType: The type of the parameter. If index is
beyond the length of Parameters, and VariadicParameterType is not null, VariadicParameterType is returned.
Exceptions
System.ArgumentOutOfRangeExceptionThrown whenindexis less than zero, or is beyond the length of Parameters and VariadicParameterType isnull.
#ToString()
public override string ToString();Returns String
Generated from Yarn Spinner for Unity 3.3.