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...
Property in ConstantTypeProperty
Gets the value that is stored in this property.
public IConvertible Value { get; }Method in Dialogue
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 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.
string nodeName
The name of the node.
The string ID.
Method in Dialogue
Gets a value indicating whether a specified node exists in the Program.
string nodeName
The name of the node.
true if a node named nodeName exists in the Program, false otherwise.
Property in Dialogue
Gets or sets the content saliency strategy used by this Dialogue .
public Saliency.IContentSaliencyStrategy ContentSaliencyStrategy { get; set; }A content saliency strategy is a class that implements IContentSaliencyStrategy and selects the most appropriate content in a line group, or any other situation where content saliency is relevant.
public string? GetStringIDForNode(string nodeName)public bool NodeExists(string nodeName)Method in Dialogue
Prepares the Dialogue that the user intends to start running a node.
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.
string startNode
The name of the node that will be run. The node have been loaded by calling SetProgram(Program) .
Method in Dialogue
This method is obsolete and may be removed from a future version of Yarn Spinner: Use GetHeaderValue(nodeName, "tags"), and split the result by spaces.
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.
string nodeName
The name of the node.
The node's tags, or null if the node is not present in the Program.
Class in Yarn.Utility
Inherits from System.Object
Provides a method for generating CRC32 hashes of strings.
Computes a CRC32 checksum from the given bytes.
Computes a CRC32 checksum from the given string.
Gets the CRC-32 hash of s as a string containing 8 lowercase hexadecimal characters.
Delegate in Yarn
Inherits from System.MulticastDelegate
Represents the method that is called when the Dialogue delivers a Command .
Yarn.Command command
The Command 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.
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.
Method in Dialogue
Loads all nodes from the provided Program .
This method replaces any existing nodes have been loaded.
Yarn.Program program
The Program to use.
Constructor in Dialogue
Initializes a new instance of the Dialogue class.
Yarn.IVariableStorage variableStorage
The IVariableStorage that this Dialogue should use.
Method in Dialogue
Queries the Dialogue for what content could possibly run if the node group nodeGroup was run.
This method evaluates all nodes in the given node group, and returns a ContentSaliencyOption object for each node. This object contains the current number of passing and failing 'when' clauses on the node, as well as the complexity score for that node. This is the same information that's passed to a IContentSaliencyStrategy object's QueryBestContent(IEnumerable<ContentSaliencyOption>) method. This method is read-only, and calling it will not modify any variable state.
Note that this method does not filter its output, and may include content options whose FailingConditionValueCount is greater than zero. It's up to the caller of this function to filter out these options if they're not wanted.
This method can be used to see if any content will appear when a given node group is run. If the collection returned by this method is empty, then running this node group will not result in any content. This can be used, for example, to decide whether to show a 'character can be spoken to' indicator. You can also examine the individal ContentSaliencyOption objects to see if any content is available that passes a filter, such as whether content might appear that has a user-defined 'plot critical' tag.
string nodeGroup
The name of the node group to get available content for.
A collection of ContentSaliencyOption objects that may appear if and when the node group nodeGroup is run.
Property in Dialogue
Gets or sets the LineHandler that is called when a line is ready to be shown to the user.
public LineHandler? LineHandler { get; set; }Property in Dialogue
Invoked when the Dialogue needs to report debugging information.
public Logger? LogDebugMessage { get; set; }Property in Dialogue
Gets or sets the NodeCompleteHandler that is called when a node is complete.
public NodeCompleteHandler? NodeCompleteHandler { get; set; }Property in Dialogue
Gets the names of the nodes in the currently loaded Program.
public IEnumerable<string> NodeNames { get; }If no program is currently loaded, an empty collection is returned.
Property in EnumType
Gets the collection of enum cases in this enum.
public IEnumerable<KeyValuePair<string, ConstantTypeProperty>> EnumCases { get; }Property in FunctionType
Gets the type of value that this function returns.
public IType ReturnType { get; internal set; }Property in FunctionType
Gets the type of value that this type of function accepts as a variadic parameter.
public IType? VariadicParameterType { get; internal set; }This value is null if this type of function does not accept variadic parameters.
public void SetNode(string startNode = DefaultStartNodeName)public IEnumerable<string> GetTagsForNode(string nodeName)public static class CRC32public delegate void CommandHandler(Command command);public void SetProgram(Program program)public Dialogue(Yarn.IVariableStorage variableStorage)public IEnumerable<Saliency.ContentSaliencyOption> GetSaliencyOptionsForNodeGroup(string nodeGroup)Constructor in EnumType
Initializes a new instance of the EnumType class that represents an enum type. This type has no methods of its own, and is a subtype of Any .
public EnumType(string name, string description, TypeBase rawType)string name
The name of this method.
string description
A string that describes this method.
rawType
Method in IMarkupParser
Parses a string into markup, given a locale.
public MarkupParseResult ParseMarkup(string rawText, string localeCode);string rawText
The text to parse.
string localeCode
Interface in Yarn
Contains methods for parsing raw text into a MarkupParseResult .
public interface IMarkupParserParses a string into markup, given a locale.
Class in
Inherits from
The base type for all enumeration types.
Method in
The locale to use when parsing the text.
public override string ToString()public class EnumBase : TypeBaseInitialises a new instance of the class.
Gets a string describing this type.
Gets the name of this type.
Gets the parent of this type.
Class in Yarn
Inherits from System.Object
Co-ordinates the execution of Yarn programs.
public class Dialogue : ISmartVariableEvaluatorInitializes a new instance of the class.
The node that execution will start from.
Starts, or continues, execution of the current Program.
Gets the collection of headers present on the node named nodeName .
Gets or sets the that is called when a command is to be delivered to the game.
Gets or sets the content saliency strategy used by this .
Gets the value of the header named headerName on the node named nodeName , or null if the header can't be found.
Queries the for what content could possibly run if the node group nodeGroup was run.
Returns the string ID that contains the original, uncompiled source text for a node.
Returns the tags for the node nodeName .
Returns if the node group has any potential nodes to be run based on the current salient selector.
Gets a value indicating whether nodeName is the name of a valid node group in the program.
Gets a value indicating whether a specified node exists in the Program.
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 .
Evaluate the value of a smart variable named name .
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 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.
Method in
public void MergeFrom(pb::CodedInputStream input)Google.Protobuf.CodedInputStream input
Method in Dialogue
Gets a value indicating whether nodeName is the name of a valid node group in the program.
string nodeName
The name of the node group to check.
true if nodeName is the name of a node group; false otherwise.
public bool IsNodeGroup(string nodeName)Property in
The value of the header.
public string Value { get; set; }Method in Dialogue
Signals to the Dialogue that the user has selected a specified Option .
public void SetSelectedOption(int selectedOptionID)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.
: 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.
Method in
public override bool Equals(object other)object other
Co-ordinates the execution of Yarn programs.
An exception that is thrown by when there is an error in executing a .
The base type for all enumeration types.
A type that represents enumerations.
A type that represents a function.
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.
Provides the base class for all concrete types.
Contains the built-in types available in the Yarn language.
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.
Represents different kinds of variables that can be fetched from a using .
Contains methods for parsing raw text into a .
Contains methods for evaluating the value of smart variables
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.
Represents the method that is called when the Dialogue delivers a .
Represents a method that receives diagnostic messages and error information from 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 begins executing a node.
Represents the method that is called when the Dialogue delivers an .
Represents the method that is called when the dialogue anticipates that it will deliver lines.
Defines properties that describe a type in the Yarn language.
Provides properties used to work with members of a type.
Provides a mechanism for retrieving values.
Provides a mechanism for storing values.
Represents a read-only value in the Yarn Spinner virtual machine.
Contains classes for choosing the most relevant content out of a set of possible options.
Contains classes for working with Yarn Spinner in the Unity game engine.
Contains utility classes used by Yarn Spinner.
A set of s, sent from the to the game.
Property in
Gets or sets the that is called when a command is to be delivered to the game.
public CommandHandler? CommandHandler { get; set; }Property in
Gets or sets the that is called when a node is started.
Method in
Immediately stops the .
Method in
Returns if the node group has any potential nodes to be run based on the current salient selector.
True if there is any salient content for the requested node group
public NodeStartHandler? NodeStartHandler { get; set; }public void Stop()string nodeGroup
The name of the node group.
public bool HasSalientContent(string nodeGroup)Method in Dialogue
Starts, or continues, execution of the current Program.
public void Continue()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 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, 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.
Property in
Gets the parent of this type.
All types have as their ultimate parent type (except for itself.)
Property in
public IType Parent { get; }public static pbr::MessageDescriptor Descriptor { get; }Method in CRC32
Gets the CRC-32 hash of s as a string containing 8 lowercase hexadecimal characters.
public static string GetChecksumString(string s)This method converts the string to a UTF-8 encoding, and then computes a CRC32 checksum from those bytes.
string s
The string containing the checksum.
The string to get the checksum of.
Method in
Gets the collection of headers present on the node named nodeName .
A collection of key-values pairs, each one representing a header on the node.
string nodeName
The name of the node to get headers for.
public IEnumerable<KeyValuePair<string, string>> GetHeaders(string nodeName)Property in
Gets or sets the object that provides access to storing and retrieving the values of variables.
public IVariableStorage VariableStorage { get; set; }Field in
The node that execution will start from.
public const string DefaultStartNodeName = "Start";Delegate in Yarn
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.
public delegate void DialogueCompleteHandler();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 .
: 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.
Class in Yarn
Inherits from System.Object
public sealed class Header : pb::IMessage<Header>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessageField number for the "key" field.
Field number for the "value" field.
The name of the header.
Gets a string describing this type.
Gets the collection of enum cases in this enum.
Gets the name of this type.
The value of the header.
Gets the parent of this type.
Gets the type of this enum's members.
Property in
Gets the collection of type information for this type's type members.
public IReadOnlyDictionary<string, ITypeMember> TypeMembers { get }Class in Yarn
Inherits from System.Object
Represents a property that belongs to a type and contains a read-only value.
public class ConstantTypeProperty : ITypeMemberThis kind of type member is useful for constant properties, like enum cases.
Property in
Gets a more verbose description of this type.
string Description { get; }Gets a string describing this property.
Gets the type of this property.
Gets the value that is stored in this property.
Property in
Invoked when the Dialogue needs to report an error.
public Logger? LogErrorMessage { get; set; }Property in
Gets a string describing this property.
public string Description { get; }Method in CRC32
Computes a CRC32 checksum from the given bytes.
byte[] bytes
The bytes to generate a checksum for.
A CRC32 checksum derived from bytes .
public static uint GetChecksum(byte[] bytes)Interface in
Defines properties that describe a type in the Yarn language.
public interface ITypeGets a more verbose description of this type.
Gets the name of this type.
Gets the parent of this type.
Gets the collection of type information for this type's type members.
Property in
Gets a string describing this type.
public override string Description { get }Method in
public bool Equals(IType other)other
Interface in Yarn
Contains methods for evaluating the value of smart variables
public interface ISmartVariableEvaluatorEvaluate the value of a smart variable named name .
Method in Dialogue
Gets the value of the header named headerName on the node named nodeName , or null if the header can't be found.
public string? GetHeaderValue(string nodeName, string headerName)If the node has more than one header named headerName , the first one is used.
The value of the first header on the node with the specified header value.
string nodeName
The name of the node.
string headerName
The name of the header.
Property in Dialogue
Gets or sets the DialogueCompleteHandler that is called when the dialogue reaches its end.
public DialogueCompleteHandler? DialogueCompleteHandler { get; set; }Method in FunctionType
Gets the type of the parameter at the given index.
public IType GetParameterAt(int index)int index
The index of the parameter to get the type for.
The type of the parameter. If index is beyond the length of , and is not null , is returned.
Method in ISmartVariableEvaluator
Evaluate the value of a smart variable named name .
bool TryGetSmartVariable<T>(string name, out T result);string name
The name of the variable.
true if the smart variable was evaluated, false otherwise.
T result
On return, contains the returned value of the smart variable, or the default value of T if a smart variable named name could not be found or its value could not be returned as type T .
T
The type of the returned value.
Property in
Gets the text of the command.
public string Text { get; private set; }Property in
Gets the collection of type information for this type's type members.
System.Collections.Generic.IReadOnlyDictionary<string, ITypeMember> TypeMembers { get; }Constructor in
public Header(Header other)other
Constructor in FunctionType
Initialises a new instances of the FunctionType class.
public FunctionType(IType returnType, params IType[] parameterTypes)returnType
The type of the value that this type of function returns.
parameterTypes
The types of the parameters that this type of function accepts.
Property in
Gets or sets the that is called when the dialogue anticipates delivering some lines.
public PrepareForLinesHandler? PrepareForLinesHandler { get; set; }Field in
Field number for the "value" field.
public const int ValueFieldNumber = 2;Property in
The name of the header.
public string Key { get; set; }Method in Dialogue
Evaluate the value of a smart variable named name .
public bool TryGetSmartVariable<T>(string name, out T result)string name
The name of the variable.
true if the smart variable was evaluated, false otherwise.
T result
On return, contains the returned value of the smart variable, or the default value of T if a smart variable named name could not be found or its value could not be returned as type T .
T
The type of the returned value.
Method in
public override string ToString();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.
public Library Library { get; internal set; }Property in
Gets a string describing this type.
public override string Description { get }Property in
Gets a value indicating whether the Dialogue is currently executing Yarn instructions.
public bool IsActive { get }Property in
Gets the type of this enum's members.
public TypeBase RawType { get }Property in
Gets a more verbose description of this type.
public string Description { get; set; }Method in
public void WriteTo(pb::CodedOutputStream output)Google.Protobuf.CodedOutputStream output
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 ).
public List<IType> Parameters { get; }Method in CRC32
Computes a CRC32 checksum from the given string.
This method converts the string to a UTF-8 encoding, and then computes a CRC32 checksum from those bytes.
string s
The string to generate a checksum for.
A CRC32 checksum derived from s .
public static uint GetChecksum(string s)Struct in Yarn
Inherits from System.ValueType
A command, sent from the Dialogue to the game.
public struct CommandYou do not create instances of this struct yourself. They are created by the Dialogue during program execution.
: Gets or sets the that is called when a command is to be delivered to the game.
Gets the text of the command.
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; }Class in Yarn
Inherits from System.Object
A type that represents a function.
public class FunctionType : IType, IEquatable<IType>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.)
Initialises a new instances of the class.
Gets the type of the parameter at the given index.
Gets a more verbose description of this type.
Gets the name of this type.
Gets the list of the parameter types that this function is called with.
Gets the parent of this type.
Gets the type of value that this function returns.
Gets the collection of type information for this type's type members.
Gets the type of value that this type of function accepts as a variadic parameter.
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; }Property in
Gets the type of this property.
public IType Type { get; }