Declaration.CreateVariable(string,IType,IConvertible,string?)

Method in Declaration

Summary

Creates a new instance of the Declaration class, using the given name, type and default value.

public static Declaration CreateVariable(string name, IType type, IConvertible defaultValue, string? description = null)

Parameters

NameDescription
string nameThe name of the new declaration.
Yarn.IType typeThe type of the declaration.
System.IConvertible defaultValueThe default value of the declaration. This must be a string, a number (integer or floating-point), or boolean value.
string descriptionThe description of the new declaration.

Returns

A new instance of the Declaration class.