All pages
Powered by GitBook
1 of 38

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

ToString()

Method in BasicBlock

Summary

public override string ToString();

AddDestination(string,Condition)

Method in BasicBlock

Summary

Adds a new destination to this block, that points to a node.

public void AddDestination(string nodeName, Condition condition)

Parameters

Name
Description

string nodeName

The name of the destination node.

NodeName

Property in

Gets the name of the node that this block is in.

CommandText

Field in

The text of the command.

ExpressionIsTrue

Enumeration Member in

The Destination is reached because an expression evaluated to true.

ExpressionIsFalse

Enumeration Member in

The Destination is reached because an expression evaluated to false.

FirstInstructionIndex

Property in

Gets the index of the first instruction of the node that this block is in.

PlayerVisibleContent

Property in

Gets the collection of player-visible content that will be delivered when this block is run.

Player-visible content means lines, options and commands. When this block is run, the entire contents of this collection will be displayed to the player, in the same order as they appear in this collection.

If this collection is empty, then the block contains no visible content. This is the case for blocks that only contain logic, and do not contain any lines, options or commands.

To tell the difference between the different kinds of content, use the is operator to check the type of each item:

Block

Enumeration Member in

DestinationType

Enum in

Inherits from System.Enum

The type of a Destination.

Name
Description

BasicBlock

Class in

Inherits from System.Object

A basic block is a run of instructions inside a Node. Basic blocks group instructions up into segments such that execution only ever begins at the start of a block (that is, a program never jumps into the middle of a block), and execution only ever leaves at the end of a block.

Name
Description

Descendants

Property in

Gets all descendants (that is, destinations, and destinations of those destinations, and so on), recursively.

Cycles are detected and avoided.

Ancestors

Property in

Get the ancestors of this block - that is, blocks that may run immediately before this block.

LabelName

Property in

Gets the name of the label that this block begins at, or null if this basic block does not begin at a labelled instruction.

CommandElement

Class in

Inherits from

A command that will be executed.

Name
Description

Instructions

Property in

Gets the Instructions that form this block.

Yarn.Compiler.BasicBlock.Condition condition

The condition under which descendant will be run.

public string NodeName { get; set; }

Summary

BasicBlock
public string CommandText;

Summary

CommandElement
ExpressionIsTrue

Summary

Condition
ExpressionIsFalse

Summary

Condition
public int FirstInstructionIndex { get; set; }

Summary

BasicBlock
public IEnumerable<PlayerVisibleContentElement> PlayerVisibleContent
{
            get; }

Summary

Remarks

BasicBlock
Block

Summary

DestinationType
public IEnumerable<BasicBlock> Descendants
{
            get; }

Summary

Remarks

BasicBlock
public IEnumerable<BasicBlock> Ancestors { get };

Summary

BasicBlock
public string LabelName { get; set; }

Summary

BasicBlock
public class CommandElement : PlayerVisibleContentElement

CommandText

The text of the command.

Summary

Fields

BasicBlock
PlayerVisibleContentElement
public IEnumerable<Instruction> Instructions { get; set; };

Summary

BasicBlock

Type

Property in Destination

Summary

Gets the Destination's type - whether the destination is a block, or a node.

public DestinationType Type { get; set; }

NodeName

Property in Destination

Summary

The name of the node that this destination refers to.

public string NodeName { get; set; }

Remarks

This value is only valid when Type is Node .

Options

Field in OptionsElement

Summary

The collection of options that will be delivered to the player.

public IEnumerable<Option> Options;

Node

Enumeration Member in DestinationType

Summary

Node

DirectJump

Enumeration Member in Condition

Summary

The Destination is reached beacuse of an explicit instruction to go to this block.

DirectJump
foreach (var item in block.PlayerVisibleContent) { if (item is
LineElement line) { // Do something with line } }

public enum DestinationType
{
    Node,
    Block
}

Block

Summary

Members

Destination

A command that will be executed.

A line of dialogue that should be shown to the player.

A collection of options that should be shown to the player.

An abstract class that represents some content that is shown to the player.

Name
Description

The conditions under which a may be reached at the end of a BasicBlock.

Name
Description

Adds a new destination to this block, that points to a node.

Adds a new destination to this block, that points to another block.

Name
Description

Get the ancestors of this block - that is, blocks that may run immediately before this block.

Gets all descendants (that is, destinations, and destinations of those destinations, and so on), recursively.

Name
Description

A destination represents a or node that may be run, following the execution of a .

public class BasicBlock

Summary

Classes

Yarn.Compiler

Enums

Methods

Properties

Structs

Destination

Struct in

Inherits from System.ValueType

A destination represents a or node that may be run, following the execution of a .

Destination objects represent links between blocks, or between blocks and nodes.

Name
Description

LineID

Field in

The string table ID that will be shown to the player.

OptionsElement

Class in

Inherits from

A collection of options that should be shown to the player.

Name
Description
Node

Gets all descendants (that is, destinations, and destinations of those destinations, and so on) that have any player-visible content, recursively.

Destinations

Gets the destinations of this block - that is, blocks or nodes that may run immediately after this block.

FirstInstructionIndex

Gets the index of the first instruction of the node that this block is in.

Instructions

Gets the Instructions that form this block.

LabelName

Gets the name of the label that this block begins at, or null if this basic block does not begin at a labelled instruction.

Name

Gets a descriptive name for the block.

NodeName

Gets the name of the node that this block is in.

PlayerVisibleContent

Gets the collection of player-visible content that will be delivered when this block is run.

CommandElement
LineElement
OptionsElement
PlayerVisibleContentElement
Condition
Destination
AddDestination(string,Condition)
AddDestination(BasicBlock,Condition)
ToString()
Ancestors
Descendants
DescendantsWithPlayerVisibleContent
Destination
BasicBlock
BasicBlock
public string LineID;

Summary

Option

LineID

Field in LineElement

Summary

The string table ID of the line that will be shown to the player.

public string LineID;

Name

Property in BasicBlock

Summary

Gets a descriptive name for the block.

public string Name
{
            get; }

Remarks

If this block begins at a labelled instruction, the name will be [NodeName].[LabelName] . Otherwise, it will be [NodeName].[FirstInstructionIndex] .

The type of a Destination.

Name
Description

The block that this destination refers to.

The condition that causes this destination to be reached.

public struct Destination

Summary

Remarks

Enums

BasicBlock
BasicBlock
BasicBlock

Properties

Name
Description

Represents a single option that may be presented to the player.

public class OptionsElement : PlayerVisibleContentElement

Options

The collection of options that will be delivered to the player.

Summary

Fields

Structs

BasicBlock
PlayerVisibleContentElement

PlayerVisibleContentElement

Class in

Inherits from System.Object

An abstract class that represents some content that is shown to the player.

This class is used, rather than the runtime classes Yarn.Line or Yarn.OptionSet, because when the program is being analysed, no values for any substitutions are available. Instead, these classes represent the data that is available offline.

Block

Property in

The block that this destination refers to.

This value is only valid when is .

Option
public abstract class PlayerVisibleContentElement

Summary

Remarks

BasicBlock
public BasicBlock Block { get; set; }

Summary

Remarks

Destination
Type
Block

The name of the node that this destination refers to.

Gets the Destination's type - whether the destination is a block, or a node.

DestinationType
Block
Condition
NodeName

Condition

Property in

The condition that causes this destination to be reached.

Destination

Field in

The destination that will be run if this option is selected by the player.

This will be the name of a label, or the name of a node.

DescendantsWithPlayerVisibleContent

Property in

Gets all descendants (that is, destinations, and destinations of those destinations, and so on) that have any player-visible content, recursively.

Cycles are detected and avoided.

Type
public Condition Condition { get; set; }

Summary

Destination
public string Destination;

Summary

Remarks

Option
public IEnumerable<BasicBlock> DescendantsWithPlayerVisibleContent
{
            get; }

Summary

Remarks

BasicBlock

Condition

Enum in BasicBlock

Inherits from System.Enum

Summary

The conditions under which a Destination may be reached at the end of a BasicBlock.

public enum Condition
{
    Fallthrough,
    DirectJump,
    ExpressionIsTrue,
    ExpressionIsFalse,
    Option
}

Members

Name
Description

The Destination is reached beacuse of an explicit instruction to go to this block.

The Destination is reached because an expression evaluated to false.

The Destination is reached because an expression evaluated to true.

The Destination is reached because the preceding BasicBlock reached the end of its execution, and the Destination's target is the block immediately following.

The Destination is reached because the player made an in-game choice to go to it.

DirectJump
ExpressionIsFalse
ExpressionIsTrue
Fallthrough
Option

Option

Enumeration Member in

The Destination is reached because the player made an in-game choice to go to it.

Option

Summary

Condition

AddDestination(BasicBlock,Condition)

Method in BasicBlock

Summary

Adds a new destination to this block, that points to another block.

public void AddDestination(BasicBlock descendant, Condition condition)

Parameters

Name
Description

descendant

The new descendant node.

condition

The condition under which descendant will be run.

Yarn.Compiler.BasicBlock
Yarn.Compiler.BasicBlock.Condition

Option

Struct in OptionsElement

Inherits from System.ValueType

Summary

Represents a single option that may be presented to the player.

public struct Option

Fields

Name
Description

The destination that will be run if this option is selected by the player.

The string table ID that will be shown to the player.

Destination
LineID

Destinations

Property in

Gets the destinations of this block - that is, blocks or nodes that may run immediately after this block.

  • : A destination represents a or node that may be run, following the execution of a .

public IEnumerable<Destination> Destinations { get };

Summary

See Also

BasicBlock
Destination
BasicBlock
BasicBlock

Fallthrough

Enumeration Member in

The Destination is reached because the preceding BasicBlock reached the end of its execution, and the Destination's target is the block immediately following.

Fallthrough

Summary

Condition

LineElement

Class in

Inherits from

A line of dialogue that should be shown to the player.

Name
Description
public class LineElement : PlayerVisibleContentElement

The string table ID of the line that will be shown to the player.

Summary

Fields

BasicBlock
PlayerVisibleContentElement
LineID