All pages
Powered by GitBook
Couldn't generate the PDF for 525 pages, generation stopped at 100.
Extend with 50 more pages.
1 of 100

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

C#

CommandHandler

Property in

Gets or sets the that is called when a command is to be delivered to the game.

CurrentNode

Property in

Gets the name of the node that this Dialogue is currently executing.

If has never been called, this value will be null .

LogDebugMessage

Property in

Invoked when the Dialogue needs to report debugging information.

NodeNames

Property in

Gets the names of the nodes in the currently loaded Program.

NodeStartHandler

Property in

Gets or sets the that is called when a node is started.

Parent

Property in

Gets the parent of this type.

All types have as their ultimate parent type (except for itself.)

public CommandHandler CommandHandler
{
            get; set; }

Summary

Dialogue
CommandHandler
public string CurrentNode
{
            get; }

Summary

Remarks

Dialogue
Continue()
public Logger LogDebugMessage { get; set; }

Summary

Dialogue
public IEnumerable<string> NodeNames
{
            get; }

Summary

Dialogue
public NodeStartHandler NodeStartHandler
{
            get; set; }

Summary

Dialogue
NodeStartHandler
IType Parent { get; }

Summary

Remarks

IType
Any
Any

Any

Property in BuiltinTypes

Summary

Gets the type representing any value.

public static IType Any { get; };

Boolean

Property in BuiltinTypes

Summary

Gets the type representing boolean values.

public static IType Boolean { get; };

Number

Property in BuiltinTypes

Summary

Gets the type representing numbers.

public static IType Number { get; };

String

Property in BuiltinTypes

Summary

Gets the type representing strings.

public static IType String { get; };

TypeMappings

Property in BuiltinTypes

Summary

Gets a dictionary that maps CLR types to their corresponding Yarn types.

public static IReadOnlyDictionary<System.Type, Yarn.IType> TypeMappings { get; };

Text

Property in Command

Summary

Gets the text of the command.

public string Text { get; private set; }

DefaultStartNodeName

Field in Dialogue

Summary

The node that execution will start from.

public const string DefaultStartNodeName = "Start";

NodeExists(string)

Method in Dialogue

Summary

Gets a value indicating whether a specified node exists in the Program.

Parameters

Name
Description

string nodeName

The name of the node.

Returns

true if a node named nodeName exists in the Program, false otherwise.

Stop()

Method in Dialogue

Summary

Immediately stops the Dialogue .

public void Stop()

Remarks

The DialogueCompleteHandler will not be called if the dialogue is ended by calling Stop() .

UnloadAll()

Method in Dialogue

Summary

Unloads all nodes from the Dialogue.

public void UnloadAll()

DialogueCompleteHandler

Property in Dialogue

Summary

Gets or sets the DialogueCompleteHandler that is called when the dialogue reaches its end.

public DialogueCompleteHandler DialogueCompleteHandler
{
            get; set; }

IsActive

Property in Dialogue

Summary

Gets a value indicating whether the Dialogue is currently executing Yarn instructions.

public bool IsActive { get };

LanguageCode

Property in Dialogue

Summary

Gets or sets the Dialogue 's locale, as an IETF BCP 47 code.

public string LanguageCode { get; set; }

Remarks

This code is used to determine how the plural and ordinal markers determine the plural class of numbers.

For example, the code "en-US" represents the English language as used in the United States.

Library

Property in Dialogue

Summary

Gets the Library that this Dialogue uses to locate functions.

public Library Library { get; internal set; }

Remarks

When the Dialogue is constructed, the Library is initialized with the built-in operators like + , - , and so on.

LineHandler

Property in Dialogue

Summary

Gets or sets the LineHandler that is called when a line is ready to be shown to the user.

public LineHandler LineHandler
{
            get; set; }

NodeCompleteHandler

Property in Dialogue

Summary

Gets or sets the NodeCompleteHandler that is called when a node is complete.

public NodeCompleteHandler NodeCompleteHandler
{
            get; set; }

LogErrorMessage

Property in Dialogue

Summary

Invoked when the Dialogue needs to report an error.

public Logger LogErrorMessage { get; set; }

PrepareForLinesHandler

Property in Dialogue

Summary

Gets or sets the PrepareForLinesHandler that is called when the dialogue anticipates delivering some lines.

public PrepareForLinesHandler PrepareForLinesHandler
{
            get; set; }

VariableStorage

Property in Dialogue

Summary

Gets or sets the object that provides access to storing and retrieving the values of variables.

public IVariableStorage VariableStorage { get; set; }

DialogueException

Class in Yarn

Inherits from System.Exception

Summary

An exception that is thrown by Dialogue when there is an error in executing a Program .

public class DialogueException : System.Exception

Description

Property in FunctionType

Summary

Gets a more verbose description of this type.

public string Description
{
            get; set; }

Methods

Property in FunctionType

Summary

Gets the collection of methods that are available on this type.

public MethodCollection Methods { get };

Name

Property in FunctionType

Summary

Gets the name of this type.

public string Name { get; }

Parameters

Property in FunctionType

Summary

Gets the list of the parameter types that this function is called with.

public List<IType> Parameters { get; };

Remarks

The length of this list also determines the number of parameters this function accepts (also known as the function's arity ).

Parent

Property in FunctionType

Summary

Gets the parent of this type.

public IType Parent { get; }

Remarks

All types have Any as their ultimate parent type (except for Any itself.)

ReturnType

Property in FunctionType

Summary

Gets the type of value that this function returns.

public IType ReturnType { get; internal set; }

Description

Property in IType

Summary

Gets a more verbose description of this type.

string Description { get; }

Methods

Property in IType

Summary

Gets the collection of methods that are available on this type.

MethodCollection Methods { get; }

Name

Property in IType

Summary

Gets the name of this type.

string Name { get; }

Clear()

Method in IVariableStorage

Summary

Removes all variables from storage.

void Clear();

ID

Field in Line

Summary

The string ID for this line.

public string ID;

Tags

Property in Node

Summary

The tags associated with this node.

public pbc::RepeatedField<string> Tags {
      get; }

ToString()

Method in Node

Summary

public override string ToString()

SourceTextStringID

Property in Node

Summary

the entry in the program's string table that contains the original text of this node; null if this is not available

public string SourceTextStringID {
      get; set; }
public bool NodeExists(string nodeName)

Dialogue(Yarn.IVariableStorage)

Constructor in Dialogue

Summary

Initializes a new instance of the Dialogue class.

public Dialogue(Yarn.IVariableStorage variableStorage)

Parameters

Name
Description

variableStorage

The that this Dialogue should use.

AddProgram(Program)

Method in Dialogue

Summary

Loads the nodes from the specified Program , and adds them to the nodes already loaded.

public void AddProgram(Program program)

Remarks

If Yarn.Dialogue.Program is null , this method has the effect as calling SetProgram(Program) .

Parameters

Name
Description

GetStringIDForNode(string)

Method in Dialogue

Summary

Returns the string ID that contains the original, uncompiled source text for a node.

public string GetStringIDForNode(string nodeName)

Remarks

A node's source text will only be present in the string table if its tags header contains rawText.

Because the Dialogue class is designed to be unaware of the contents of the string table, this method does not test to see if the string table contains an entry with the line ID. You will need to test for that yourself.

Parameters

Name
Description

The string ID.

ParseMarkup(string)

Method in Dialogue

Summary

Parses a line of text, and produces a MarkupParseResult containing the results.

public MarkupParseResult ParseMarkup(string line)

Remarks

The MarkupParseResult 's Text will have any select , plural or ordinal markers replaced with the appropriate text, following this Dialogue 's LanguageCode .

Parameters

Name
Description

The results of parsing the markup.

SetValue(string,string)

Method in IVariableStorage

Summary

Stores a string in this VariableStorage.

void SetValue(string variableName, string stringValue);

Parameters

Name
Description

string variableName

DeregisterFunction(string)

Method in Library

Summary

Removes a function from the Library.

public void DeregisterFunction(string name)

Remarks

If no function with the given name is present in the Library, this method does nothing.

Parameters

Name
Description

string name

FunctionExists(string)

Method in Library

Summary

Gets a value indicating whether this Library contains a function named name .

public bool FunctionExists(string name)

Parameters

Name
Description

string name

true if a function exists in this Library; false otherwise.

ImportLibrary(Library)

Method in Library

Summary

Loads functions from another Library .

public void ImportLibrary(Library otherLibrary)

Remarks

If the other library contains a function with the same name as one in this library, the function in the other library takes precedence.

Parameters

Name
Description

otherLibrary

BuiltinTypes

Class in Yarn

Inherits from System.Object

Summary

Contains the built-in types available in the Yarn language.

public static class BuiltinTypes

Properties

Name
Description

Command

Struct in

Inherits from System.ValueType

A command, sent from the to the game.

You do not create instances of this struct yourself. They are created by the during program execution.

Name
Description

CommandHandler

Delegate in

Inherits from System.MulticastDelegate

Represents the method that is called when the Dialogue delivers a .

Name
Description

ExpandSubstitutions(string,IList<string>)

Method in

Replaces all substitution markers in a text with the given substitution list.

This method replaces substitution markers - for example, {0}

  • with the corresponding entry in substitutions . If text contains a substitution marker whose index is not present in substitutions , it is ignored.

GetTagsForNode(string)

Method in

Returns the tags for the node nodeName .

The tags for a node are defined by setting the tags header in the node's source code. This header must be a space-separated list.

Name
Description

SetNode(string)

Method in

Prepares the that the user intends to start running a node.

After this method is called, you call to start executing it.

If has been set, it may be called when this method is invoked, as the Dialogue determines which lines may be delivered during the startNode node's execution.

Name
Description

SetProgram(Program)

Method in

Loads all nodes from the provided .

This method replaces any existing nodes have been loaded. If you want to load nodes from an additional Program, use the method.

Name
Description

OptionsHandler

Property in

Gets or sets the that is called when a set of options are ready to be shown to the user.

The Options Handler delivers an to the game. Before can be called to resume execution, must be called to indicate which was selected by the user. If is not called, an exception is thrown.

DialogueCompleteHandler

Delegate in

Inherits from System.MulticastDelegate

Represents the method that is called when the dialogue has reached its end, and no more code remains to be run.

  • : Represents the method that is called when the Dialogue delivers a .

IType

Interface in

Defines properties that describe a type in the Yarn language.

Name
Description

IVariableStorage

Interface in

Provides a mechanism for storing and retrieving instances of the Yarn.Value class.

Name
Description

SetValue(string,bool)

Method in

Stores a bool in this VariableStorage.

Name
Description

RegisterFunction(string,Delegate)

Method in

Registers a new function that returns a value, which can be called from a Yarn program.

Name
Description

RegisterFunction(string,Func<T1, T2, TResult>)

Method in

Registers a new function that returns a value, which can be called from a Yarn program.

Name
Description

Yarn Namespace

Contains classes for working with compiled Yarn programs.

Name
Description

RegisterFunction(string,Func<T1, T2, T3, T4, T5, TResult>)

Method in

Registers a new function that returns a value, which can be called from a Yarn program.

Name
Description

SetValue(string,float)

Method in

Stores a float in this VariableStorage.

Name
Description

SetValue(string,float)

Method in

Stores a float in this VariableStorage.

Name
Description

Substitutions

Field in

The values that should be inserted into the user-facing text before delivery.

SetValue(string,string)

Method in

Stores a string in this VariableStorage.

Name
Description

GetFunction(string)

Method in

Returns a System.Delegate with a given name.

Name
Description

Yarn.Program program

The additional program to load.

The name to associate with this variable.

string stringValue

The string to store.

The name of the function to remove.

Any

Gets the type representing any value.

Boolean

Gets the type representing boolean values.

Number

Gets the type representing numbers.

String

Gets the type representing strings.

TypeMappings

Gets a dictionary that maps CLR types to their corresponding Yarn types.

string nodeName

The name of the node.

Returns

string line

The line of text to parse.

Returns

The name of the function to look for.

Returns

Yarn.IVariableStorage
IVariableStorage

The library to import functions from.

Yarn.Library
Name
Description

string text

The text containing substitution markers.

System.Collections.Generic.IList<string> substitutions

The list of substitutions.

text , with the content from substitutions inserted.

Summary

Remarks

Parameters

Dialogue

Returns

string nodeName

The name of the node.

The node's tags, or null if the node is not present in the Program.

Summary

Remarks

Parameters

Dialogue

Returns

public OptionsHandler OptionsHandler
{
            get; set; }

Summary

Remarks

Dialogue
OptionsHandler
OptionSet
Continue()
SetSelectedOption(int)
Option
SetSelectedOption(int)
: Represents the method that is called when the Dialogue delivers an
.
  • CommandHandler: Represents the method that is called when the Dialogue delivers a Command .

  • NodeStartHandler: Represents the method that is called when the Dialogue begins executing a node.

  • NodeCompleteHandler: Represents the method that is called when the Dialogue reaches the end of a node.

  • Summary

    See Also

    Yarn
    LineHandler
    Line
    OptionsHandler
    OptionSet

    bool boolValue

    The boolean value to store.

    string variableName

    Summary

    Parameters

    IVariableStorage

    The name to associate with this variable.

    System.Delegate implementation

    The method to be invoked when the function is called.

    Name
    Description

    TResult

    The return type of the function.

    string name

    The name of the function.

    Summary

    Parameters

    Library

    Type Parameters

    float floatValue

    The number to store.

    string variableName

    Summary

    Parameters

    IVariableStorage

    The name to associate with this variable.

    float floatValue

    The number to store.

    string variableName

    Summary

    Parameters

    MemoryVariableStore

    The name to associate with this variable.

    public string[] Substitutions;

    Summary

    Line

    string stringValue

    The string to store.

    string variableName

    Summary

    Parameters

    MemoryVariableStore

    The name to associate with this variable.

    The System.Delegate .

    string name

    Summary

    Parameters

    Library

    The name of the function to retrieve.

    Returns

    Name

    Property in Node

    Summary

    The name of this node.

    public string Name {
          get; set; }

    Labels

    Property in Node

    Summary

    A jump table, mapping the names of labels to positions in the instructions list.

    public pbc::MapField<string, int> Labels {
          get; }

    DestinationNode

    Property in Option

    Summary

    Gets the name of the node that will be run if this option is selected.

    public string DestinationNode { get; private set; }

    Remarks

    The value of this property not be valid if this is a shortcut option.

    Instructions

    Property in Node

    Summary

    The list of instructions in this node.

    public pbc::RepeatedField<global::Yarn.Instruction> Instructions {
          get; }
    public static string ExpandSubstitutions(string text, IList<string> substitutions)
    public IEnumerable<string> GetTagsForNode(string nodeName)
    public delegate void DialogueCompleteHandler();
    void SetValue(string variableName, bool boolValue);
    public void RegisterFunction(string name, Delegate implementation)
    void SetValue(string variableName, float floatValue);
    public void SetValue(string variableName, float floatValue)
    public void SetValue(string variableName, string stringValue)
    public Delegate GetFunction(string name)

    Gets the text of the command.

    • Dialogue.CommandHandler: Gets or sets the CommandHandler that is called when a command is to be delivered to the game.

    public struct Command

    Summary

    Remarks

    Properties

    Yarn
    Dialogue
    Dialogue

    See Also

    The that has been delivered.

    • LineHandler: Represents the method that is called when the Dialogue delivers a Line .

    • OptionsHandler: Represents the method that is called when the Dialogue delivers an OptionSet .

    • NodeStartHandler: Represents the method that is called when the Dialogue begins executing a node.

    • : Represents the method that is called when the Dialogue reaches the end of a node.

    • : Represents the method that is called when the dialogue has reached its end, and no more code remains to be run.

    public delegate void CommandHandler(Command command);

    Summary

    Parameters

    Yarn
    Command

    command

    See Also

    string startNode

    The name of the node that will be run. The node have been loaded by calling or .

    public void SetNode(string startNode = DefaultStartNodeName)

    Summary

    Remarks

    Parameters

    Dialogue
    Dialogue
    Continue()
    PrepareForLinesHandler

    The to use.

    public void SetProgram(Program program)

    Summary

    Remarks

    Parameters

    Dialogue
    Program
    AddProgram(Program)

    program

    Gets the collection of methods that are available on this type.

    Gets the name of this type.

    Gets the parent of this type.

    public interface IType

    Description

    Gets a more verbose description of this type.

    Summary

    Properties

    Yarn

    Stores a bool in this VariableStorage.

    Stores a float in this VariableStorage.

    Stores a string in this VariableStorage.

    Retrieves a value of type T by name.

    public interface IVariableStorage

    Clear()

    Summary

    Methods

    Yarn

    Removes all variables from storage.

    System.Func<T1, T2, TResult> implementation

    The method to be invoked when the function is called.

    Name
    Description

    TResult

    The return type of the function.

    TResult

    The return type of the function.

    public void RegisterFunction<T1, T2, TResult>(string name, Func<T1, T2, TResult> implementation)

    string name

    The name of the function.

    Summary

    Parameters

    Library

    Type Parameters

    Co-ordinates the execution of Yarn programs.

    An exception that is thrown by when there is an error in executing a .

    A type that represents functions.

    A collection of functions that can be called from Yarn programs.

    A simple concrete implementation of that keeps all variables in memory.

    A node of Yarn script, contained within a , and containing Yarn.Instruction s.

    A compiled Yarn program.

    Name
    Description

    Represents the method that is called when the Dialogue delivers a .

    Represents the method that is called when the dialogue has reached its end, and no more code remains to be run.

    Name
    Description

    Defines properties that describe a type in the Yarn language.

    Provides a mechanism for storing and retrieving instances of the Yarn.Value class.

    Name
    Description

    Contains classes for compiling Yarn code.

    Contains classes for working with markup in Yarn lines.

    Name
    Description

    A command, sent from the to the game.

    A line of dialogue, sent from the to the game.

    BuiltinTypes

    Contains the built-in types available in the Yarn language.

    Summary

    Classes

    Delegates

    Interfaces

    Namespaces

    Structs

    System.Func<T1, T2, T3, T4, T5, TResult> implementation

    The method to be invoked when the function is called.

    Name
    Description

    TResult

    The return type of the function.

    TResult

    The return type of the function.

    public void RegisterFunction<T1, T2, T3, T4, T5, TResult>(string name, Func<T1, T2, T3, T4, T5, TResult> implementation)

    string name

    The name of the function.

    Summary

    Parameters

    Library

    Type Parameters

    SetSelectedOption(int)

    Method in Dialogue

    Summary

    Signals to the Dialogue that the user has selected a specified Option .

    public void SetSelectedOption(int selectedOptionID)

    Remarks

    After the Dialogue delivers an OptionSet, this method must be called before Continue() is called.

    The ID number that should be passed as the parameter to this method should be the ID field in the Option that represents the user's selection.

    Parameters

    Name
    Description
    • : Represents the method that is called when the Dialogue delivers an .

    • : A set of s, sent from the to the game.

    • : Starts, or continues, execution of the current Program.

    TryGetValue(string,T)

    Method in IVariableStorage

    Summary

    Retrieves a value of type T by name.

    bool TryGetValue<T>(string variableName, out T result);

    Parameters

    Name
    Description

    string variableName

    Name
    Description

    true if a value named variableName of type T was retrieved; false otherwise.

    LineHandler

    Delegate in Yarn

    Inherits from System.MulticastDelegate

    Summary

    Represents the method that is called when the Dialogue delivers a Line .

    public delegate void LineHandler(Line line);

    Parameters

    Name
    Description
    • : Represents the method that is called when the Dialogue delivers an .

    • : Represents the method that is called when the Dialogue delivers a .

    • : Represents the method that is called when the Dialogue begins executing a node.

    RegisterFunction(string,Func<TResult>)

    Method in Library

    Summary

    Registers a new function that returns a value, which can be called from a Yarn program.

    public void RegisterFunction<TResult>(string name, Func<TResult> implementation)

    Parameters

    Name
    Description

    string name

    The name of the function.

    Name
    Description

    Node

    Class in Yarn

    Inherits from System.Object

    Summary

    A node of Yarn script, contained within a Program , and containing Yarn.Instruction s.

    public class Node

    Methods

    Name
    Description
    Name
    Description

    MemoryVariableStore

    Class in Yarn

    Inherits from System.Object

    Summary

    A simple concrete implementation of IVariableStorage that keeps all variables in memory.

    public class MemoryVariableStore : IVariableStorage

    Methods

    Name
    Description

    RegisterFunction(string,Func<T1, TResult>)

    Method in Library

    Summary

    Registers a new function that returns a value, which can be called from a Yarn program.

    public void RegisterFunction<T1, TResult>(string name, Func<T1, TResult> implementation)

    Parameters

    Name
    Description

    string name

    The name of the function.

    Name
    Description

    TryGetValue(string,T)

    Method in MemoryVariableStore

    Summary

    Retrieves a value of type T by name.

    public bool TryGetValue<T>(string variableName, out T result)

    Parameters

    Name
    Description

    string variableName

    Name
    Description

    true if a value named variableName of type T was retrieved; false otherwise.

    Logger

    Delegate in Yarn

    Inherits from System.MulticastDelegate

    Summary

    Represents a method that receives diagnostic messages and error information from a Dialogue .

    public delegate void Logger(string message);

    Remarks

    The text that this delegate receives may be output to a console, or sent to a log.

    Parameters

    Name
    Description

    NodeCompleteHandler

    Delegate in Yarn

    Inherits from System.MulticastDelegate

    Summary

    Represents the method that is called when the Dialogue reaches the end of a node.

    public delegate void NodeCompleteHandler(string completedNodeName);

    Remarks

    This method may be called multiple times over the course of code execution. A node being complete does not necessarily represent the end of the conversation.

    Parameters

    Name
    Description
    • : Represents the method that is called when the Dialogue delivers a .

    • : Represents the method that is called when the Dialogue delivers an .

    • : Represents the method that is called when the Dialogue delivers a .

    Continue()

    Method in

    Starts, or continues, execution of the current Program.

    This method repeatedly executes instructions until one of the following conditions is encountered:

    • The or is called. After calling either of these handlers, the Dialogue will wait until is called. Continue may be called from inside the or , or may be called at any future time.

    RegisterFunction(string,Func<T1, T2, T3, T4, TResult>)

    Method in

    Registers a new function that returns a value, which can be called from a Yarn program.

    Name
    Description

    IsAvailable

    Property in

    Gets a value indicating whether the player should be permitted to select this option.

    If this value is false, this option had a line condition on it that failed. The option will still be delivered to the game, but, depending on the needs of the game, the game may decide to not allow the player to select it, or not offer it to the player at all.

    This is intended for situations where games wish to show options that the player _could_ have taken, if some other condition had been met (e.g. having enough "charisma" points).

    Clear()

    Method in

    Removes all variables from storage.

    SetValue(string,bool)

    Method in

    Stores a bool in this VariableStorage.

    Name
    Description

    Options

    Property in

    Gets the s that should be presented to the user.

    • : An option to be presented to the user.

    T1

    The type of the function's first argument.

    T2

    The type of the function's second argument.

    T1

    The type of the function's first argument.

    T2

    The type of the function's second argument.

    T3

    The type of the function's third argument.

    T4

    The type of the function's fourth argument.

    T5

    The type of the function's fifth argument.

    Clear()

    Removes all variables from storage.

    SetValue(string,bool)

    Stores a bool in this VariableStorage.

    SetValue(string,float)

    Stores a float in this VariableStorage.

    SetValue(string,string)

    Stores a string in this VariableStorage.

    TryGetValue(string,T)

    Retrieves a value of type T by name.

    string message

    The text that should be logged.

    The name of the variable to retrieve the value of.

    T result

    On return, if this method returned true, contains the retrieved value. If this method returned false, contains the default value of T (for example, 0 for float values, null for strings, and so on.)

    T

    The type of the variable to retrieve.

    Type Parameters

    Returns

    System.Func<TResult> implementation

    The method to be invoked when the function is called.

    TResult

    The return type of the function.

    Type Parameters

    The name of the variable to retrieve the value of.

    T result

    On return, if this method returned true, contains the retrieved value. If this method returned false, contains the default value of T (for example, 0 for float values, null for strings, and so on.)

    T

    The type of the variable to retrieve.

    Type Parameters

    Returns

    int selectedOptionID

    The ID number of the Option that the user selected.

    See Also

    OptionsHandler
    OptionSet
    OptionSet
    Option
    Dialogue
    Dialogue.Continue()
    NodeCompleteHandler: Represents the method that is called when the Dialogue reaches the end of a node.
  • DialogueCompleteHandler: Represents the method that is called when the dialogue has reached its end, and no more code remains to be run.

  • Yarn.Line line

    The Line that has been delivered.

    See Also

    OptionsHandler
    OptionSet
    CommandHandler
    Command
    NodeStartHandler

    NodeStartHandler: Represents the method that is called when the Dialogue begins executing a node.

  • DialogueCompleteHandler: Represents the method that is called when the dialogue has reached its end, and no more code remains to be run.

  • string completedNodeName

    The name of the node.

    See Also

    LineHandler
    Line
    OptionsHandler
    OptionSet
    CommandHandler
    Command
    Text
    NodeCompleteHandler
    DialogueCompleteHandler
    Yarn.Command
    Command
    SetProgram(Program)
    AddProgram(Program)
    Yarn.Program
    Program
    Methods
    Name
    Parent
    SetValue(string,bool)
    SetValue(string,float)
    SetValue(string,string)
    TryGetValue(string,T)

    LineHandler

    Represents the method that is called when the Dialogue delivers a Line .

    Logger

    Represents a method that receives diagnostic messages and error information from a Dialogue .

    NodeCompleteHandler

    Represents the method that is called when the Dialogue reaches the end of a node.

    NodeStartHandler

    Represents the method that is called when the Dialogue begins executing a node.

    OptionsHandler

    Represents the method that is called when the Dialogue delivers an OptionSet .

    PrepareForLinesHandler

    Represents the method that is called when the dialogue anticipates that it will deliver lines.

    Yarn.Unity

    Contains classes for working with Yarn Spinner in the Unity game engine.

    OptionSet

    A set of Option s, sent from the Dialogue to the game.

    Dialogue
    DialogueException
    Dialogue
    Program
    FunctionType
    Library
    MemoryVariableStore
    IVariableStorage
    Node
    Program
    Program
    CommandHandler
    Command
    DialogueCompleteHandler
    IType
    IVariableStorage
    Yarn.Compiler
    Yarn.Markup
    Command
    Dialogue
    Line
    Dialogue

    The type of the function's first argument.

    System.Func<T1, TResult> implementation

    The method to be invoked when the function is called.

    TResult

    The return type of the function.

    TResult

    The return type of the function.

    Type Parameters

    T1

    public bool IsAvailable { get; private set; }

    Summary

    Remarks

    Option
    public void Clear()

    Summary

    MemoryVariableStore

    bool boolValue

    The boolean value to store.

    string variableName

    Summary

    Parameters

    MemoryVariableStore

    The name to associate with this variable.

    public Option[] Options { get; private set; }

    Summary

    See Also

    OptionSet
    Option
    Option

    ID

    Property in Option

    Summary

    Gets the identifying number for this option.

    public int ID { get; private set; }

    Remarks

    When the user selects this option, this value should be used as the parameter for SetSelectedOption(int) .

    Line

    Property in Option

    Summary

    Gets the Line that should be presented to the user for this option.

    public Line Line { get; private set; }

    Remarks

    See the documentation for the Line class for information on how to prepare a line before presenting it to the user.

    public void SetValue(string variableName, bool boolValue)

    The name of this node.

    the entry in the program's string table that contains the original text of this node; null if this is not available

    The tags associated with this node.

    ToString()

    Instructions

    The list of instructions in this node.

    Labels

    A jump table, mapping the names of labels to positions in the instructions list.

    Properties

    The OptionsHandler is called. When this occurs, the Dialogue is waiting for the user to specify which of the options has been selected, and SetSelectedOption(int) must be called before Continue() is called again.)
  • The Program reaches its end. When this occurs, SetNode(string) must be called before Continue() is called again.

  • An error occurs while executing the Program.

  • This method has no effect if it is called while the Dialogue is currently in the process of executing instructions.

    • LineHandler: Represents the method that is called when the Dialogue delivers a Line .

    • OptionsHandler: Represents the method that is called when the Dialogue delivers an OptionSet .

    • CommandHandler: Represents the method that is called when the Dialogue delivers a Command .

    • : Represents the method that is called when the Dialogue reaches the end of a node.

    • : Represents the method that is called when the dialogue has reached its end, and no more code remains to be run.

    public void Continue()

    Summary

    Remarks

    Dialogue
    LineHandler
    CommandHandler
    Continue()
    LineHandler
    CommandHandler

    See Also

    System.Func<T1, T2, T3, T4, TResult> implementation

    The method to be invoked when the function is called.

    Name
    Description

    TResult

    The return type of the function.

    TResult

    The return type of the function.

    public void RegisterFunction<T1, T2, T3, T4, TResult>(string name, Func<T1, T2, T3, T4, TResult> implementation)

    string name

    The name of the function.

    Summary

    Parameters

    Library

    Type Parameters

    Line

    Struct in Yarn

    Inherits from System.ValueType

    Summary

    A line of dialogue, sent from the Dialogue to the game.

    public struct Line

    Remarks

    When the game receives a Line, it should do the following things to prepare the line for presentation to the user.

    1. Use the value in the ID field to look up the appropriate user-facing text in the string table.

    2. Use to replace all substitutions in the user-facing text.

    3. Use to parse all markup in the line.

    You do not create instances of this struct yourself. They are created by the during program execution.

    Name
    Description
    • : Gets or sets the that is called when a line is ready to be shown to the user.

    OptionSet

    Struct in Yarn

    Inherits from System.ValueType

    Summary

    A set of Option s, sent from the Dialogue to the game.

    public struct OptionSet

    Remarks

    You do not create instances of this struct yourself. They are created by the Dialogue during program execution.

    Properties

    Name
    Description
    Name
    Description
    • : Gets or sets the that is called when a set of options are ready to be shown to the user.

    Option

    Struct in OptionSet

    Inherits from System.ValueType

    Summary

    An option to be presented to the user.

    public struct Option

    Properties

    Name
    Description

    NodeStartHandler

    Delegate in Yarn

    Inherits from System.MulticastDelegate

    Summary

    Represents the method that is called when the Dialogue begins executing a node.

    public delegate void NodeStartHandler(string startedNodeName);

    Parameters

    Name
    Description
    • : Represents the method that is called when the Dialogue delivers a .

    • : Represents the method that is called when the Dialogue delivers an .

    • : Represents the method that is called when the Dialogue delivers a .

    Library

    Class in

    Inherits from System.Object

    A collection of functions that can be called from Yarn programs.

    You do not create instances of this class yourself. The class creates one of its own, which you can access via the property.

    Name

    RegisterFunction(string,Func<T1, T2, T3, TResult>)

    Method in

    Registers a new function that returns a value, which can be called from a Yarn program.

    Name
    Description

    T1

    The type of the function's first argument.

    T2

    The type of the function's second argument.

    T3

    The type of the function's third argument.

    T4

    The type of the function's fourth argument.

    DestinationNode

    Gets the name of the node that will be run if this option is selected.

    ID

    Gets the identifying number for this option.

    IsAvailable

    Gets a value indicating whether the player should be permitted to select this option.

    Line

    Gets the Line that should be presented to the user for this option.

    NodeCompleteHandler
    DialogueCompleteHandler

    ID

    The string ID for this line.

    Substitutions

    The values that should be inserted into the user-facing text before delivery.

    Fields

    See Also

    ExpandSubstitutions(string,IList<string>)
    ParseMarkup(string)
    Dialogue
    Dialogue.LineHandler
    LineHandler

    Options

    Gets the Option s that should be presented to the user.

    Option

    An option to be presented to the user.

    Structs

    See Also

    Dialogue.OptionsHandler
    OptionsHandler

    NodeCompleteHandler: Represents the method that is called when the Dialogue reaches the end of a node.

  • DialogueCompleteHandler: Represents the method that is called when the dialogue has reached its end, and no more code remains to be run.

  • string startedNodeName

    The name of the node.

    See Also

    LineHandler
    Line
    OptionsHandler
    OptionSet
    CommandHandler
    Command
    Name
    SourceTextStringID
    Tags
    Description

    Removes a function from the Library.

    Gets a value indicating whether this contains a function named name .

    Returns a System.Delegate with a given name.

    Loads functions from another .

    • Dialogue: Co-ordinates the execution of Yarn programs.

    public class Library

    Summary

    Remarks

    Methods

    Yarn
    Dialogue
    Library

    See Also

    System.Func<T1, T2, T3, TResult> implementation

    The method to be invoked when the function is called.

    Name
    Description

    TResult

    The return type of the function.

    TResult

    The return type of the function.

    public void RegisterFunction<T1, T2, T3, TResult>(string name, Func<T1, T2, T3, TResult> implementation)

    string name

    The name of the function.

    Summary

    Parameters

    Library

    Type Parameters

    FunctionType

    Class in Yarn

    Inherits from System.Object

    Summary

    A type that represents functions.

    public class FunctionType : IType

    Remarks

    Functions have parameters and a return type, and can be called from script. Instances of this type are created when the host application registers new functions (such as through using the RegisterFunction(string,Delegate) methods or similar.)

    Properties

    Name
    Description

    T1

    The type of the function's first argument.

    T2

    The type of the function's second argument.

    T3

    The type of the function's third argument.

    Gets a more verbose description of this type.

    Gets the collection of methods that are available on this type.

    Gets the name of this type.

    Gets the list of the parameter types that this function is called with.

    Registers a new function that returns a value, which can be called from a Yarn program.

    Registers a new function that returns a value, which can be called from a Yarn program.

    Registers a new function that returns a value, which can be called from a Yarn program.

    Registers a new function that returns a value, which can be called from a Yarn program.

    Registers a new function that returns a value, which can be called from a Yarn program.

    Registers a new function that returns a value, which can be called from a Yarn program.

    Registers a new function that returns a value, which can be called from a Yarn program.

    DeregisterFunction(string)
    FunctionExists(string)
    Library
    GetFunction(string)
    ImportLibrary(Library)
    Library
    RegisterFunction(string,Delegate)
    RegisterFunction(string,Func)
    RegisterFunction(string,Func<T1, TResult>)
    RegisterFunction(string,Func<T1, T2, TResult>)
    RegisterFunction(string,Func<T1, T2, T3, TResult>)
    RegisterFunction(string,Func<T1, T2, T3, T4, TResult>)
    RegisterFunction(string,Func<T1, T2, T3, T4, T5, TResult>)

    Gets the parent of this type.

    Gets the type of value that this function returns.

    Description
    Methods
    Name
    Parameters
    Parent
    ReturnType

    Dialogue

    Class in Yarn

    Inherits from System.Object

    Summary

    Co-ordinates the execution of Yarn programs.

    public class Dialogue : IAttributeMarkerProcessor

    Constructors

    Name
    Description
    Name
    Description
    Name
    Description
    Name
    Description

    Initializes a new instance of the class.

    The node that execution will start from.

    Loads the nodes from the specified , and adds them to the nodes already loaded.

    Starts, or continues, execution of the current Program.

    Gets or sets the that is called when a command is to be delivered to the game.

    Fields

    Methods

    Properties

    Replaces all substitution markers in a text with the given substitution list.

    Returns the string ID that contains the original, uncompiled source text for a node.

    Returns the tags for the node nodeName .

    Gets a value indicating whether a specified node exists in the Program.

    Parses a line of text, and produces a containing the results.

    Prepares the that the user intends to start running a node.

    Loads all nodes from the provided .

    Signals to the that the user has selected a specified .

    Immediately stops the .

    Unloads all nodes from the Dialogue.

    Gets the name of the node that this Dialogue is currently executing.

    Gets or sets the that is called when the dialogue reaches its end.

    Gets a value indicating whether the Dialogue is currently executing Yarn instructions.

    Gets or sets the 's locale, as an IETF BCP 47 code.

    Gets the that this Dialogue uses to locate functions.

    Gets or sets the that is called when a line is ready to be shown to the user.

    Invoked when the Dialogue needs to report debugging information.

    Invoked when the Dialogue needs to report an error.

    Gets or sets the that is called when a node is complete.

    Gets the names of the nodes in the currently loaded Program.

    Gets or sets the that is called when a node is started.

    Gets or sets the that is called when a set of options are ready to be shown to the user.

    Gets or sets the that is called when the dialogue anticipates delivering some lines.

    Gets or sets the object that provides access to storing and retrieving the values of variables.

    Dialogue(Yarn.IVariableStorage)
    Dialogue
    DefaultStartNodeName
    AddProgram(Program)
    Program
    Continue()
    CommandHandler
    CommandHandler
    CurrentNode
    ExpandSubstitutions(string,IList)
    GetStringIDForNode(string)
    GetTagsForNode(string)
    NodeExists(string)
    ParseMarkup(string)
    MarkupParseResult
    SetNode(string)
    Dialogue
    SetProgram(Program)
    Program
    SetSelectedOption(int)
    Dialogue
    Option
    Stop()
    Dialogue
    UnloadAll()
    DialogueCompleteHandler
    DialogueCompleteHandler
    IsActive
    LanguageCode
    Dialogue
    Library
    Library
    LineHandler
    LineHandler
    LogDebugMessage
    LogErrorMessage
    NodeCompleteHandler
    NodeCompleteHandler
    NodeNames
    NodeStartHandler
    NodeStartHandler
    OptionsHandler
    OptionsHandler
    PrepareForLinesHandler
    PrepareForLinesHandler
    VariableStorage