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 BasicBlock
Gets all descendants (that is, destinations, and destinations of those destinations, and so on), recursively.
public IEnumerable<BasicBlock> Descendants
{
get; }Cycles are detected and avoided.
public IEnumerable<BasicBlock> Ancestors { get };string nodeName
The name of the destination node.
condition
The condition under which descendant will be run.
public void AddDestination(string nodeName, Condition condition)Method in BasicBlock
Adds a new destination to this block, that points to another block.
public void AddDestination(BasicBlock descendant, Condition condition)Class in Yarn.Compiler
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.
public class BasicBlockYarn.Compiler.BasicBlock descendant
The new descendant node.
Yarn.Compiler.BasicBlock.Condition condition
The condition under which descendant will be run.
Property in BasicBlock
Gets the index of the first instruction of the node that this block is in.
public int FirstInstructionIndex { get; set; }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.
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.
The conditions under which a Destination may be reached at the end of a BasicBlock.
Adds a new destination to this block, that points to a node.
Adds a new destination to this block, that points to another block.
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.
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.
A destination represents a BasicBlock or node that may be run, following the execution of a BasicBlock .
BlockDirectJumppublic BasicBlock Block { get; set; }If this block begins at a labelled instruction, the name will be [NodeName].[LabelName] . Otherwise, it will be [NodeName].[FirstInstructionIndex] .
public string Name
{
get; }public string LabelName { get; set; }public string NodeName { get; set; }ExpressionIsFalseExpressionIsTruepublic string LineID;Fallthroughpublic Condition Condition { get; set; }public IEnumerable<Instruction> Instructions { get; set; };Field in OptionsElement
The collection of options that will be delivered to the player.
public IEnumerable<Option> Options;Property in BasicBlock
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; }Cycles are detected and avoided.
Property in BasicBlock
Gets the name of the node that this block is in.
public string NodeName { get; set; }Class in BasicBlock
Inherits from PlayerVisibleContentElement
A line of dialogue that should be shown to the player.
public class LineElement : PlayerVisibleContentElementProperty in BasicBlock
Gets the collection of player-visible content that will be delivered when this block is run.
public IEnumerable<PlayerVisibleContentElement> PlayerVisibleContent
{
get; }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:
Class in BasicBlock
Inherits from PlayerVisibleContentElement
A command that will be executed.
public class CommandElement : PlayerVisibleContentElementStruct in OptionsElement
Inherits from System.ValueType
Represents a single option that may be presented to the player.
public struct OptionThe string table ID of the line that will be shown to the player.
The text of the command.
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.
foreach (var item in block.PlayerVisibleContent) { if (item is
LineElement line) { // Do something with line } }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.
public abstract class PlayerVisibleContentElementThis will be the name of a label, or the name of a node.
public string Destination;public DestinationType Type { get; set; }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.
Destination objects represent links between blocks, or between blocks and nodes.
The type of a Destination.
The block that this destination refers to.
The condition that causes this destination to be reached.
The name of the node that this destination refers to.
Gets the Destination's type - whether the destination is a block, or a node.
The collection of options that will be delivered to the player.
Represents a single option that may be presented to the player.
public class OptionsElement : PlayerVisibleContentElementEnum in Destination
Inherits from System.Enum
The type of a Destination.
public enum DestinationType
{
Node,
Block
}public enum Condition
{
Fallthrough,
DirectJump,
ExpressionIsTrue,
ExpressionIsFalse,
Option
}public struct DestinationOptionProperty in BasicBlock
Gets the destinations of this block - that is, blocks or nodes that may run immediately after this block.
public IEnumerable<Destination> Destinations { get };: A destination represents a or node that may be run, following the execution of a .