All pages
Powered by GitBook
Couldn't generate the PDF for 766 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#

Yarn Namespace

Summary

Contains classes for working with compiled Yarn programs.

Classes

Name
Description

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

Name
Description
Name
Description
Name
Description
Name
Description

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.

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.

Defines properties that describe a type in the Yarn language.

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

Contains classes for compiling Yarn code.

Contains classes for working with markup in Yarn lines.

A command, sent from the to the game.

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

Delegates

Interfaces

Namespaces

Structs

BuiltinTypes

String

Property in

Gets the type representing strings.

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
Header
Library
MemoryVariableStore
IVariableStorage
Node
Program
Program
CommandHandler
Command
DialogueCompleteHandler
IType
IVariableStorage
Yarn.Compiler
Yarn.Markup
Command
Dialogue
Line
Dialogue
public static IType String { get; };

Summary

BuiltinTypes

Description

Property in FunctionType

Summary

Gets a more verbose description of this type.

public string Description
{
            get; set; }

CommandHandler

Property in Dialogue

Summary

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

public CommandHandler CommandHandler
{
            get; set; }

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.)

Name

Property in FunctionType

Summary

Gets the name of this type.

public string Name { get; }

CommandHandler

Delegate in Yarn

Inherits from System.MulticastDelegate

Summary

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

public delegate void CommandHandler(Command command);

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 begins executing a node.

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

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.

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.

BuiltinTypes

Class in

Inherits from System.Object

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

Name
Description

GetStringIDForNode(string)

Method in

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

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

Because the 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.

Name

Methods

Property in

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

DialogueException

Class in

Inherits from System.Exception

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

Parameters

Property in

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

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

Number

Property in

Gets the type representing numbers.

Stop()

Method in

Immediately stops the .

The will not be called if the dialogue is ended by calling .

WriteTo(pb::CodedOutputStream)

Method in

Name
Description

Equals(Header)

Method in

Name
Description

ToString()

Method in

MergeFrom(Header)

Method in

Name
Description

Clone()

Method in

ReturnType

Property in

Gets the type of value that this function returns.

FunctionExists(string)

Method in

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

Name
Description

Yarn.Program program

The additional program to load.

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.Command command

    The Command that has been delivered.

    See Also

    LineHandler
    Line
    OptionsHandler
    OptionSet
    NodeStartHandler
    Yarn.IVariableStorage
    IVariableStorage
    public OptionsHandler OptionsHandler
    {
                get; set; }

    Summary

    Remarks

    Dialogue
    OptionsHandler
    OptionSet
    Continue()
    SetSelectedOption(int)
    Option
    SetSelectedOption(int)
    Description

    string nodeName

    The name of the node.

    The string ID.

    Summary

    Remarks

    Parameters

    Dialogue
    Dialogue

    Returns

    public MethodCollection Methods { get };

    Summary

    FunctionType
    public class DialogueException : System.Exception

    Summary

    Yarn
    Dialogue
    Program
    public List<IType> Parameters { get; };

    Summary

    Remarks

    FunctionType
    public static IType Number { get; };

    Summary

    BuiltinTypes
    public void Stop()

    Summary

    Remarks

    Dialogue
    Dialogue
    DialogueCompleteHandler
    Stop()
    public void WriteTo(pb::CodedOutputStream output)

    Google.Protobuf.CodedOutputStream output

    Summary

    Parameters

    Header
    public bool Equals(Header other)

    Yarn.Header other

    Summary

    Parameters

    Header
    public override string ToString()

    Summary

    Header
    public void MergeFrom(Header other)

    Yarn.Header other

    Summary

    Parameters

    Header
    public Header Clone()

    Summary

    Header
    public IType ReturnType { get; internal set; }

    Summary

    FunctionType

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

    string name

    Summary

    Parameters

    Library
    Library

    The name of the function to look for.

    Returns

    Boolean

    Property in BuiltinTypes

    Summary

    Gets the type representing boolean values.

    public static IType Boolean { get; };

    Substitutions

    Field in Line

    Summary

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

    public string[] Substitutions;

    ID

    Field in Line

    Summary

    The string ID for this line.

    public string ID;
    public string GetStringIDForNode(string nodeName)
    public bool FunctionExists(string name)

    Gets the type representing any value.

    Gets the type representing boolean values.

    Gets the type representing numbers.

    Gets the type representing strings.

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

    public static class BuiltinTypes

    Summary

    Properties

    Yarn

    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

    FunctionType

    Class in

    Inherits from System.Object

    A type that represents functions.

    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 methods or similar.)

    Name
    Description

    SetValue(string,bool)

    Method in

    Stores a bool in this VariableStorage.

    Name
    Description

    The name of the function to remove.

    Any
    Boolean
    Number
    String
    TypeMappings

    bool boolValue

    The boolean value to store.

    string variableName

    Summary

    Parameters

    MemoryVariableStore

    The name to associate with this variable.

    public void SetValue(string variableName, bool boolValue)

    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.

    public class FunctionType : IType

    Summary

    Remarks

    Properties

    Yarn
    RegisterFunction(string,Delegate)

    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

    Retrieves a value of type T by name.

    Name
    Description

    Parent

    Gets the parent of this type.

    ReturnType

    Gets the type of value that this function returns.

    Description
    Methods
    Name
    Parameters

    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

    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.)

    Name
    Description

    T

    The type of the variable to retrieve.

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

    string variableName

    Summary

    Parameters

    IVariableStorage

    The name of the variable to retrieve the value of.

    Type Parameters

    Returns

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

    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

    Removes all variables from storage.

    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.

    Clear()
    SetValue(string,bool)
    SetValue(string,float)
    SetValue(string,string)
    TryGetValue(string,T)

    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

    Descriptor

    Property in

    public static pbr::MessageDescriptor Descriptor {
          get; }

    Summary

    Header

    GetHashCode()

    Method in

    public override int GetHashCode()

    Summary

    Header

    Header()

    Constructor in

    public Header()

    Summary

    Header

    Header(Header)

    Constructor in

    Name
    Description
    public Header(Header other)

    other

    Summary

    Parameters

    Header
    Yarn.Header

    Continue()

    Method in Dialogue

    Summary

    Starts, or continues, execution of the current Program.

    public void Continue()

    Remarks

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

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

    • The is called. When this occurs, the Dialogue is waiting for the user to specify which of the options has been selected, and must be called before is called again.)

    • The Program reaches its end. When this occurs, must be called before is called again.

    • An error occurs while executing the Program.

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

    • : 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 .

    : 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.

  • See Also

    OptionsHandler
    SetSelectedOption(int)
    Continue()
    SetNode(string)
    Continue()
    Dialogue
    LineHandler
    Line
    OptionsHandler
    OptionSet
    CommandHandler
    Command
    NodeCompleteHandler
    DialogueCompleteHandler

    SetValue(string,string)

    Method in IVariableStorage

    Summary

    Stores a string in this VariableStorage.

    void SetValue(string variableName, string stringValue);

    Parameters

    Name
    Description

    string variableName

    Logger

    Delegate in

    Inherits from System.MulticastDelegate

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

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

    Name
    Description

    The name to associate with this variable.

    string stringValue

    The string to store.

    public delegate void Logger(string message);

    Summary

    Remarks

    Parameters

    Yarn
    Dialogue

    string message

    The text that should be logged.

    Text

    Property in

    Gets the text of the command.

    public string Text { get; private set; }

    Summary

    Command

    DefaultStartNodeName

    Field in

    The node that execution will start from.

    public const string DefaultStartNodeName = "Start";

    Summary

    Dialogue

    SetNode(string)

    Method in Dialogue

    Summary

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

    public void SetNode(string startNode = DefaultStartNodeName)

    Remarks

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

    If PrepareForLinesHandler 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.

    Parameters

    Name
    Description

    string startNode

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

    SetProgram(Program)
    AddProgram(Program)

    LanguageCode

    Property in

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

    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.

    public string LanguageCode { get; set; }

    Summary

    Remarks

    Dialogue
    Dialogue

    UnloadAll()

    Method in

    Unloads all nodes from the Dialogue.

    public void UnloadAll()

    Summary

    Dialogue

    Value

    Property in

    public string Value {
          get; set; }

    Summary

    Header

    Clear()

    Method in

    Removes all variables from storage.

    void Clear();

    Summary

    IVariableStorage

    DialogueCompleteHandler

    Property in

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

    public DialogueCompleteHandler DialogueCompleteHandler
    {
                get; set; }

    Summary

    Dialogue
    DialogueCompleteHandler

    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.

    int selectedOptionID

    The ID number of the Option that the user selected.

    See Also

    OptionsHandler
    OptionSet
    OptionSet
    Option
    Dialogue
    Dialogue.Continue()

    LogDebugMessage

    Property in Dialogue

    Summary

    Invoked when the Dialogue needs to report debugging information.

    public Logger LogDebugMessage { get; set; }

    IVariableStorage

    Interface in Yarn

    Summary

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

    public interface IVariableStorage

    Methods

    Name
    Description

    Removes all variables from storage.

    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.

    Clear()
    SetValue(string,bool)
    SetValue(string,float)
    SetValue(string,string)
    TryGetValue(string,T)

    LineHandler

    Property in

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

    public LineHandler LineHandler
    {
                get; set; }

    Summary

    Dialogue
    LineHandler

    Key

    Property in

    public string Key {
          get; set; }

    Summary

    Header

    RegisterFunction(string,Func<T1, T2, T3, T4, T5, 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, T2, T3, T4, T5, TResult>(string name, Func<T1, T2, T3, T4, T5, TResult> implementation)

    Parameters

    Name
    Description

    string name

    The name of the function.

    Name
    Description

    System.Func<T1, T2, T3, T4, T5, 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

    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.

    RegisterFunction(string,Func<T1, T2, 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, T2, TResult>(string name, Func<T1, T2, TResult> implementation)

    Parameters

    Name
    Description

    string name

    The name of the function.

    Name
    Description

    The type of the function's first argument.

    T2

    The type of the function's second argument.

    System.Func<T1, T2, 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

    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.

    The string ID for this line.

    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
    ID
    Substitutions

    VariableStorage

    Property in

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

    public IVariableStorage VariableStorage { get; set; }

    Summary

    Dialogue

    GetTagsForNode(string)

    Method in Dialogue

    Summary

    Returns the tags for the node nodeName .

    public IEnumerable<string> GetTagsForNode(string nodeName)

    Remarks

    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.

    Parameters

    Name
    Description

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

    string nodeName

    The name of the node.

    Returns

    NodeCompleteHandler

    Property in Dialogue

    Summary

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

    public NodeCompleteHandler NodeCompleteHandler
    {
                get; set; }

    ExpandSubstitutions(string,IList<string>)

    Method in Dialogue

    Summary

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

    public static string ExpandSubstitutions(string text, IList<string> substitutions)

    Remarks

    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.

    Parameters

    Name
    Description

    text , with the content from substitutions inserted.

    string text

    The text containing substitution markers.

    System.Collections.Generic.IList<string> substitutions

    The list of substitutions.

    Returns

    Parent

    Property in

    Gets the parent of this type.

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

    IType Parent { get; }

    Summary

    Remarks

    IType
    Any
    Any

    SetValue(string,bool)

    Method in IVariableStorage

    Summary

    Stores a bool in this VariableStorage.

    void SetValue(string variableName, bool boolValue);

    Parameters

    Name
    Description

    string variableName

    The name to associate with this variable.

    bool boolValue

    The boolean value to store.

    NodeNames

    Property in

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

    public IEnumerable<string> NodeNames
    {
                get; }

    Summary

    Dialogue

    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.

    string line

    The line of text to parse.

    Returns

    MergeFrom(pb::CodedInputStream)

    Method in

    Name
    Description
    public void MergeFrom(pb::CodedInputStream input)

    Google.Protobuf.CodedInputStream input

    Summary

    Parameters

    Header

    CalculateSize()

    Method in

    public int CalculateSize()

    Summary

    Header

    DialogueCompleteHandler

    Delegate in Yarn

    Inherits from System.MulticastDelegate

    Summary

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

    public delegate void DialogueCompleteHandler();

    See Also

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

    • : 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.

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

    OptionsHandler
    OptionSet
    CommandHandler
    Command
    NodeStartHandler
    NodeCompleteHandler

    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.

    public bool NodeExists(string nodeName)

    Clear()

    Method in

    Removes all variables from storage.

    public void Clear()

    Summary

    MemoryVariableStore

    GetFunction(string)

    Method in Library

    Summary

    Returns a System.Delegate with a given name.

    public Delegate GetFunction(string name)

    Parameters

    Name
    Description

    string name

    The System.Delegate .

    The name of the function to retrieve.

    Returns

    SetValue(string,float)

    Method in IVariableStorage

    Summary

    Stores a float in this VariableStorage.

    void SetValue(string variableName, float floatValue);

    Parameters

    Name
    Description

    string variableName

    The name to associate with this variable.

    float floatValue

    The number to store.

    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.

    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; }

    Description

    Property in IType

    Summary

    Gets a more verbose description of this type.

    string Description { 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; };

    GenerateUniqueVisitedVariableForNode(string)

    Method in Library

    Summary

    Generates a unique tracking variable name. This is intended to be used to generate names for visting. Ideally these will very reproduceable and sensible. For now it will be something terrible and easy.

    Parameters

    Name
    Description

    string nodeName

    The name of the node that needs to have a tracking variable created.

    Returns

    The new variable name.

    public static string GenerateUniqueVisitedVariableForNode(string nodeName)

    RegisterFunction(string,Func<TResult>)

    Method in

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

    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

    KeyFieldNumber

    Field in

    Field number for the "key" field.

    Name

    Property in

    Gets the name of this type.

    public const int KeyFieldNumber = 1;

    Summary

    Header
    string Name { get; }

    Summary

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

    string name

    The name of the function.

    Summary

    Parameters

    Library
    Name
    Description
    public void RegisterFunction(string name, Delegate implementation)

    string name

    The name of the function.

    Summary

    Parameters

    Library

    Any

    Property in

    Gets the type representing any value.

    System.Func<TResult> implementation

    The method to be invoked when the function is called.

    TResult

    The return type of the function.

    Type Parameters

    System.Delegate implementation

    The method to be invoked when the function is called.

    TResult

    The return type of the function.

    Type Parameters

    public static IType Any { get; };

    Summary

    BuiltinTypes

    IType

    Interface in Yarn

    Summary

    Defines properties that describe a type in the Yarn language.

    public interface IType

    Properties

    Name
    Description

    Gets a more verbose description of this type.

    Header

    Class in

    Inherits from System.Object

    Name
    Description

    Parser

    Property in

    Methods

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

    Name

    Gets the name of this type.

    Parent

    Gets the parent of this type.

    Description
    public static pb::MessageParser<Header> Parser { get; }

    Summary

    Header

    Name
    Description

    Field number for the "key" field.

    Field number for the "value" field.

    Name
    Description

    Name
    Description

    public sealed class Header : pb::IMessage<Header>
    #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
          , pb::IBufferMessage

    Header()

    Summary

    Constructors

    Yarn

    Fields

    Methods

    Properties

    Header(Header)
    KeyFieldNumber
    ValueFieldNumber
    CalculateSize()
    Clone()
    Descriptor
    Key
    Equals(object)
    Equals(Header)
    GetHashCode()
    MergeFrom(pb::CodedInputStream)
    MergeFrom(Header)
    ToString()
    WriteTo(pb::CodedOutputStream)
    Parser
    Value

    RegisterFunction(string,Func<T1, T2, T3, 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, T2, T3, TResult>(string name, Func<T1, T2, T3, TResult> implementation)

    Parameters

    Name
    Description

    string name

    The name of the function.

    Name
    Description

    System.Func<T1, T2, T3, 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

    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.

    Command

    Struct in Yarn

    Inherits from System.ValueType

    Summary

    A command, sent from the Dialogue to the game.

    public struct Command

    Remarks

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

    Properties

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

    Gets the text of the command.

    See Also

    Dialogue.CommandHandler
    CommandHandler
    Text

    RegisterFunction(string,Func<T1, T2, T3, T4, 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, T2, T3, T4, TResult>(string name, Func<T1, T2, T3, T4, TResult> implementation)

    Parameters

    Name
    Description

    string name

    The name of the function.

    Name
    Description

    System.Func<T1, T2, T3, T4, 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

    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.

    Library

    Class in Yarn

    Inherits from System.Object

    Summary

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

    public class Library

    Remarks

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

    Methods

    Name
    Description
    • : Co-ordinates the execution of Yarn programs.

    Removes a function from the Library.

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

    Generates a unique tracking variable name. This is intended to be used to generate names for visting. Ideally these will very reproduceable and sensible. For now it will be something terrible and easy.

    Returns a System.Delegate with a given name.

    See Also

    Dialogue

    Loads functions from another .

    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
    GenerateUniqueVisitedVariableForNode(string)
    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>)

    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.

    : 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.

  • line

    The that has been delivered.

    See Also

    OptionsHandler
    OptionSet
    CommandHandler
    Command
    NodeStartHandler
    NodeCompleteHandler
    DialogueCompleteHandler
    Yarn.Line
    Line

    IsActive

    Property in

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

    public bool IsActive { get };

    Summary

    Dialogue

    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 .

    public string CurrentNode
    {
                get; }

    Summary

    Remarks

    Dialogue
    Continue()

    LogErrorMessage

    Property in

    Invoked when the Dialogue needs to report an error.

    public Logger LogErrorMessage { get; set; }

    Summary

    Dialogue

    Equals(object)

    Method in

    Name
    Description
    public override bool Equals(object other)

    object other

    Summary

    Parameters

    Header

    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

    The library to import functions from.

    Yarn.Library

    ValueFieldNumber

    Field in

    Field number for the "value" field.

    public const int ValueFieldNumber = 2;

    Summary

    Header

    Methods

    Property in

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

    MethodCollection Methods { get; }

    Summary

    IType

    SetProgram(Program)

    Method in Dialogue

    Summary

    Loads all nodes from the provided Program .

    public void SetProgram(Program program)

    Remarks

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

    Parameters

    Name
    Description

    program

    The to use.

    Yarn.Program
    Program

    NodeStartHandler

    Property in

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

    public NodeStartHandler NodeStartHandler
    {
                get; set; }

    Summary

    Dialogue
    NodeStartHandler