All pages
Powered by GitBook
1 of 29

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

CurrentProjectFileVersion

Field in Project

Summary

The current version of .yarnproject file format.

public const int CurrentProjectFileVersion = YarnSpinnerProjectVersion3;

WorkspaceRootPlaceholder

Field in Project

Summary

A placeholder string that represents the location of the workspace root in paths.

public const string WorkspaceRootPlaceholder = "${workspaceRoot}";

YarnSpinnerProjectVersion2

Field in Project

Summary

A version number representing Yarn Spinner 2.

public const int YarnSpinnerProjectVersion2 = 2;

YarnSpinnerProjectVersion3

Field in Project

Summary

A version number representing Yarn Spinner 3.

public const int YarnSpinnerProjectVersion3 = 3;

Project()

Constructor in Project

Summary

Initializes a new instance of the Project class.

public Project()

Project(string,string?)

Constructor in Project

Summary

Initializes a new instance of the Project class.

Parameters

Name
Description

string path

The value to use for the new instance's Path property.

string workspaceRootPath

The path to the root of the current workspace, or null .

GetJson()

Method in Project

Summary

Gets a string containing JSON-formatted text that represents this Project .

public string GetJson();

Returns

The Project , serialized to JSON.

IsMatchingPath(string)

Method in Project

Summary

Gets a value indicating whether path is a path that is included in this project.

Parameters

Name
Description

string path

The path to check.

Returns

true if path is a path that is included in this project; false otherwise.

IsValidVersionNumber(int)

Method in Project

Summary

Gets a value indicating whether number is a valid Yarn Spinner version number.

public static bool IsValidVersionNumber(int number)

Parameters

Name
Description

int number

LoadFromFile(string,string?)

Method in Project

Summary

Loads and parses a Project from a file on disk.

Parameters

Name
Description

string path

The path to the file to load.

string workspaceRoot

The path of the root of the workspace in which file is located.

Returns

The loaded Project .

SaveToFile(string)

Method in Project

Summary

Saves a Project as JSON-formatted text to a file on disk.

public void SaveToFile(string path);

Parameters

Name
Description

string path

The path of the file to write to.

AllowLanguagePreviewFeatures

Property in Project

Summary

Gets or sets a value indicating whether compiler features that are not intended for production use are allowed.

public bool AllowLanguagePreviewFeatures { get; set; }

BaseLanguage

Property in Project

Summary

Gets or sets the base language of the project, as an IETF BCP-47 language tag.

public string BaseLanguage { get; set; }

Remarks

The base language is the language that the Yarn scripts is written in.

CompilerOptions

Property in Project

Summary

Gets or sets a dictionary containing instructions that control how the Yarn Spinner compiler should compile a project.

public Dictionary<string, JsonValue> CompilerOptions { get; set; }

Definitions

Property in Project

Summary

Gets or sets the path to a JSON file containing command and function definitions that this project references.

public string? Definitions { get; set; }

Remarks

Definitions files are used by editing tools to provide type information and other externally-defined data used by the Yarn scripts.

DefinitionsFiles

Property in Project

Summary

Gets the absolute paths to the project's Definitions files.

public IEnumerable<string> DefinitionsFiles { get; }

DefinitionsPath

Property in Project

This property is obsolete and may be removed from a future version of Yarn Spinner: Use DefinitionsFilesPattern.

Summary

Gets the path to the Definitions file, relative to this project's location.

public string? DefinitionsPath { get; }

See Also

  • Project.DefinitionsFiles: Gets the absolute paths to the project's Definitions files.

ExcludeFilePatterns

Property in Project

Summary

Gets or sets the collection of file search patterns that should be excluded from this project.

public IEnumerable<string> ExcludeFilePatterns { get; set; }

Remarks

If a file is matched by a pattern in SourceFilePatterns , and is also matched by a pattern in ExcludeFilePatterns , then it is not included in the value returned by SourceFiles .

ExtensionData

Property in Project

Summary

Contains any data parsed from the source file that was not matched to a property on this type.

public Dictionary<string, JsonElement>? ExtensionData { get; set; }

FileVersion

Property in Project

Summary

Gets or sets the file version of the project.

public int FileVersion { get; set; }

Remarks

This value is required to be equal to CurrentProjectFileVersion .

Localisation

Property in Project

Summary

Gets or sets the collection of LocalizationInfo objects that store information about where localized data for this project is found.

public Dictionary<string, LocalizationInfo> Localisation { get; set; }

Path

Property in Project

Summary

Gets the path that the Project was loaded from.

public string? Path { get; set; }

Remarks

This value is not stored when the file is saved, but is instead determined when the file is loaded by LoadFromFile(string,string?) , or provided when the Project is constructed.

SourceFilePatterns

Property in Project

Summary

Gets or sets the collection of file search patterns used to locate Yarn files that form this project.

public IEnumerable<string> SourceFilePatterns { get; set; }

SourceFiles

Property in Project

Summary

Gets the collection of Yarn files that should be used to compile the project.

public IEnumerable<string> SourceFiles { get; }

Remarks

This collection uses a Yarn.Compiler.Project.Matcher to find all files specified by SourceFilePatterns , excluding those that are specified by ExcludeFilePatterns .

WorkspaceRootPath

Property in Project

Summary

The location of the root of the workspace in which this project is located.

public string? WorkspaceRootPath { get; set; }

Assets

Property in LocalizationInfo

Summary

Gets or sets the location at which localized assets may be found.

public string? Assets { get; set; }

Strings

Property in LocalizationInfo

Summary

Gets or sets the location at which the localized string table may be found.

public string? Strings { get; set; }
public Project(string path, string? workspaceRootPath = null)
public bool IsMatchingPath(string path)

LocalizationInfo

Class in Project

Inherits from System.Object

Summary

Stores the locations of where localized assets and a localized string table for a Yarn Project may be found.

Properties

Name
Description

Assets

Gets or sets the location at which localized assets may be found.

Strings

Gets or sets the location at which the localized string table may be found.

public static Project LoadFromFile(string path, string? workspaceRoot = null)
public class LocalizationInfo

Project

Class in Yarn.Compiler

Inherits from System.Object

Summary

Yarn Projects represent instructions on where to find Yarn scripts and associated assets, and how they should be compiled.

public class Project

Classes

Name
Description

LocalizationInfo

Stores the locations of where localized assets and a localized string table for a Yarn Project may be found.

Constructors

Name
Description

Initializes a new instance of the class.

Initializes a new instance of the class.

Fields

Name
Description

The current version of .yarnproject file format.

A placeholder string that represents the location of the workspace root in paths.

Methods

Name
Description

Gets a string containing JSON-formatted text that represents this .

Gets a value indicating whether path is a path that is included in this project.

Properties

Name
Description

Gets or sets a value indicating whether compiler features that are not intended for production use are allowed.

Gets or sets the base language of the project, as an IETF BCP-47 language tag.

A version number representing Yarn Spinner 2.

A version number representing Yarn Spinner 3.

Gets a value indicating whether number is a valid Yarn Spinner version number.

Loads and parses a from a file on disk.

Saves a as JSON-formatted text to a file on disk.

Gets or sets a dictionary containing instructions that control how the Yarn Spinner compiler should compile a project.

Gets or sets the path to a JSON file containing command and function definitions that this project references.

Gets the absolute paths to the project's Definitions files.

Gets the path to the Definitions file, relative to this project's location.

Gets or sets the collection of file search patterns that should be excluded from this project.

Contains any data parsed from the source file that was not matched to a property on this type.

Gets or sets the file version of the project.

Gets or sets the collection of objects that store information about where localized data for this project is found.

Gets the path that the was loaded from.

Gets or sets the collection of file search patterns used to locate Yarn files that form this project.

Gets the collection of Yarn files that should be used to compile the project.

The location of the root of the workspace in which this project is located.

Project()
Project
Project(string,string?)
Project
CurrentProjectFileVersion
WorkspaceRootPlaceholder
YarnSpinnerProjectVersion2
GetJson()
Project
IsMatchingPath(string)
IsValidVersionNumber(int)
AllowLanguagePreviewFeatures
BaseLanguage
CompilerOptions
YarnSpinnerProjectVersion3
LoadFromFile(string,string?)
Project
SaveToFile(string)
Project
Definitions
DefinitionsFiles
DefinitionsPath
ExcludeFilePatterns
ExtensionData
FileVersion
Localisation
LocalizationInfo
Path
Project
SourceFilePatterns
SourceFiles
WorkspaceRootPath