All pages
Powered by GitBook
1 of 37

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

Destinations

Property in BasicBlock

Summary

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

public IEnumerable<Destination> Destinations { get };

See Also

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

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.

AddDestination(string,Condition)

Method in

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

Name
Description
public void AddDestination(string nodeName, Condition condition)

string nodeName

The name of the destination node.

Summary

Parameters

BasicBlock

condition

The condition under which descendant will be run.

Yarn.Compiler.BasicBlock

Name

Property in

Gets a descriptive name for the block.

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

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.

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.

DirectJump

Enumeration Member in

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

Node

Enumeration Member in

Descendants

Property in

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

Cycles are detected and avoided.

Yarn.Compiler.BasicBlock.Condition condition

The condition under which descendant will be run.

Yarn.Compiler.BasicBlock.Condition
public string Name
{
            get; }

Summary

Remarks

BasicBlock
Fallthrough

Summary

Condition
public abstract class PlayerVisibleContentElement

Summary

Remarks

BasicBlock
DirectJump

Summary

Condition
Node

Summary

DestinationType
public IEnumerable<BasicBlock> Descendants
{
            get; }

Summary

Remarks

BasicBlock

NodeName

Property in BasicBlock

Summary

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

public string NodeName { get; set; }

Destination

Field in Option

Summary

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

public string Destination;

Remarks

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

FirstInstructionIndex

Property in BasicBlock

Summary

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

public int FirstInstructionIndex { get; set; }

LineID

Field in LineElement

Summary

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

public string LineID;

ExpressionIsFalse

Enumeration Member in Condition

Summary

The Destination is reached because an expression evaluated to false.

ExpressionIsFalse

DescendantsWithPlayerVisibleContent

Property in BasicBlock

Summary

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

public IEnumerable<BasicBlock> DescendantsWithPlayerVisibleContent
{
            get; }

Remarks

Cycles are detected and avoided.

PlayerVisibleContent

Property in BasicBlock

Summary

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

public IEnumerable<PlayerVisibleContentElement> PlayerVisibleContent
{
            get; }

Remarks

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:

LineID

Field in Option

Summary

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

public string LineID;

Condition

Property in Destination

Summary

The condition that causes this destination to be reached.

public Condition Condition { get; set; }

LabelName

Property in BasicBlock

Summary

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

public string LabelName { get; set; }

Block

Enumeration Member in DestinationType

Summary

Block

CommandText

Field in CommandElement

Summary

The text of the command.

public string CommandText;

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 .

ExpressionIsTrue

Enumeration Member in Condition

Summary

The Destination is reached because an expression evaluated to true.

ExpressionIsTrue

Ancestors

Property in BasicBlock

Summary

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

public IEnumerable<BasicBlock> Ancestors { get };

Options

Field in OptionsElement

Summary

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

public IEnumerable<Option> Options;

Block

Property in Destination

Summary

The block that this destination refers to.

public BasicBlock Block { get; set; }

Remarks

This value is only valid when Type is Block .

Option

Enumeration Member in Condition

Summary

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

Option

Type

Property in Destination

Summary

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

public DestinationType Type { get; set; }
foreach (var item in block.PlayerVisibleContent) { if (item is
LineElement line) { // Do something with line } }

BasicBlock

Class in Yarn.Compiler

Inherits from System.Object

Summary

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.

public class BasicBlock

Classes

Name
Description
Name
Description
Name
Description
Name
Description
Name
Description

LineElement

Class in BasicBlock

Inherits from PlayerVisibleContentElement

Summary

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

public class LineElement : PlayerVisibleContentElement

Fields

Name
Description

CommandElement

Class in BasicBlock

Inherits from PlayerVisibleContentElement

Summary

A command that will be executed.

public class CommandElement : PlayerVisibleContentElement

Fields

Name
Description

DestinationType

Enum in

Inherits from System.Enum

The type of a Destination.

Name
Description

OptionsElement

Class in

Inherits from

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

Name
Description

Instructions

Property in

Gets the Instructions that form this block.

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

LineID

The text of the command.

CommandText
public IEnumerable<Instruction> Instructions { get; set; };

Summary

BasicBlock

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

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

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

Gets the Instructions that form this block.

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

Gets a descriptive name for the block.

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

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

CommandElement

A command that will be executed.

LineElement

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

OptionsElement

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

PlayerVisibleContentElement

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

Condition

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

AddDestination(string,Condition)

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

AddDestination(BasicBlock,Condition)

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

Ancestors

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

Descendants

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

Destination

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

Enums

Methods

Properties

Structs

public enum DestinationType
{
    Node,
    Block
}

Summary

Members

Destination

Name
Description

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

public class OptionsElement : PlayerVisibleContentElement

Options

Summary

Fields

BasicBlock
PlayerVisibleContentElement

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

Structs

Destination

Struct in BasicBlock

Inherits from System.ValueType

Summary

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

public struct Destination

Remarks

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

Enums

Name
Description
Name
Description

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

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
DescendantsWithPlayerVisibleContent
Destinations
FirstInstructionIndex
Instructions
LabelName
Name
NodeName
PlayerVisibleContent
Block
Node
Option

The type of a Destination.

The block that this destination refers to.

The condition that causes this destination to be reached.

Properties

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.

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.

DirectJump
ExpressionIsFalse
ExpressionIsTrue
Fallthrough
Option
Destination
LineID

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
Type