GenerateYarnFileWithDeclarations(IEnumerable<Yarn.Compiler.Declaration>,string,IEnumerable<string>,I

Method in Utility

Summary

Generates a Yarn script that contains a node that declares variables.

public static string GenerateYarnFileWithDeclarations(
    IEnumerable<Yarn.Compiler.Declaration> declarations,
    string title = "Program",
    IEnumerable<string> tags = null,
    IDictionary<string, string> headers = null)

Remarks

This method is intended to be called by tools that let the user manage variable declarations. Such tools can read the existing variable declarations in from a script (by compiling the script with the CompilationType value set to DeclarationsOnly ), allow the user to make changes, and then write the changes to disk by calling this method and saving the results.

Parameters

Name
Description

System.Collections.Generic.IEnumerable<Yarn.Compiler.Declaration> declarations

string title

The title of the node that should be generated.

System.Collections.Generic.IEnumerable<string> tags

The collection of tags that should be generated for the node. If this is null , no tags will be generated.

System.Collections.Generic.IDictionary<string, string> headers

The collection of additional headers that should be generated for the node. If this is null , no additional headers will be generated.

Returns

A string containing a Yarn script that declares the specified variables.

Last updated

Yarn Spinner® and Secret Lab® are trade marks of Secret Lab Pty. Ltd., and are used by Yarn Spinner Pty. Ltd. under license.