All pages
Powered by GitBook
1 of 30

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

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.

DefaultStartNodeName

Field in Dialogue

Summary

The node that execution will start from.

public const string DefaultStartNodeName = "Start";

LogDebugMessage

Property in Dialogue

Summary

Invoked when the Dialogue needs to report debugging information.

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

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.

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.

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.

NodeStartHandler

Property in

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

DialogueCompleteHandler

Property in

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

VariableStorage

Property in

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

CommandHandler

Property in

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

IsActive

Property in

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

Dialogue(Yarn.IVariableStorage)

Constructor in

Initializes a new instance of the class.

Name
Description

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.

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 .

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.

LogErrorMessage

Property in

Invoked when the Dialogue needs to report an error.

NodeNames

Property in

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

UnloadAll()

Method in

Unloads all nodes from the Dialogue.

PrepareForLinesHandler

Property in

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

LineHandler

Property in

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

Stop()

Method in

Immediately stops the .

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

NodeCompleteHandler

Property in

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

Library

Property in

Gets the that this Dialogue uses to locate functions.

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

string nodeName

The name of the node.

Returns

string nodeName

The name of the node.

Returns

string text

The text containing substitution markers.

System.Collections.Generic.IList<string> substitutions

The list of substitutions.

Returns

public NodeStartHandler NodeStartHandler
{
            get; set; }

Summary

Dialogue
NodeStartHandler
public DialogueCompleteHandler DialogueCompleteHandler
{
            get; set; }

Summary

Dialogue
DialogueCompleteHandler
public IVariableStorage VariableStorage { get; set; }

Summary

Dialogue
public CommandHandler CommandHandler
{
            get; set; }

Summary

Dialogue
CommandHandler
public bool IsActive { get };

Summary

Dialogue

Yarn.IVariableStorage variableStorage

The IVariableStorage that this Dialogue should use.

Summary

Parameters

Dialogue
Dialogue
public string LanguageCode { get; set; }

Summary

Remarks

Dialogue
Dialogue
public string CurrentNode
{
            get; }

Summary

Remarks

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

Summary

Dialogue
public IEnumerable<string> NodeNames
{
            get; }

Summary

Dialogue
public void UnloadAll()

Summary

Dialogue
public PrepareForLinesHandler PrepareForLinesHandler
{
            get; set; }

Summary

Dialogue
PrepareForLinesHandler
public LineHandler LineHandler
{
            get; set; }

Summary

Dialogue
LineHandler
public void Stop()

Summary

Remarks

Dialogue
Dialogue
DialogueCompleteHandler
Stop()
public NodeCompleteHandler NodeCompleteHandler
{
            get; set; }

Summary

Dialogue
NodeCompleteHandler
public Library Library { get; internal set; }

Summary

Remarks

Dialogue
Library
public Dialogue(Yarn.IVariableStorage variableStorage)
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

    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

    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.

    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.

    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

    Yarn.Program program

    The Program to use.

    Yarn.Program program

    The additional program to load.

    string line

    The line of text to parse.

    Returns

    NodeCompleteHandler
    DialogueCompleteHandler

    int selectedOptionID

    The ID number of the Option that the user selected.

    See Also

    OptionsHandler
    OptionSet
    OptionSet
    Option
    Dialogue
    Dialogue.Continue()

    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

    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.

    public OptionsHandler OptionsHandler
    {
                get; set; }

    Summary

    Remarks

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

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

    Initializes a new instance of the Dialogue class.

    DefaultStartNodeName

    The node that execution will start from.

    AddProgram(Program)

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

    Continue()

    Starts, or continues, execution of the current Program.

    CommandHandler

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

    CurrentNode

    Fields

    Methods

    Properties

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

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

    string startNode

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

    SetProgram(Program)
    AddProgram(Program)