All pages
Powered by GitBook
1 of 12

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

GetFunction(string)

Method in Library

Summary

Returns a System.Delegate with a given name.

public Delegate GetFunction(string name)

Parameters

Name
Description

Returns

The System.Delegate .

Library

Class in

Inherits from System.Object

Summary

A collection of functions that can be called from Yarn programs.

string name

The name of the function to retrieve.

Remarks

You do not create instances of this class yourself. The Dialogue class creates one of its own, which you can access via the Library property.

Methods

Name
Description

Removes a function from the Library.

Gets a value indicating whether this contains a function named name .

Returns a System.Delegate with a given name.

Loads functions from another .

Registers a new function that returns a value, which can be called from a Yarn program.

See Also

  • Dialogue: Co-ordinates the execution of Yarn programs.

Yarn
public class Library

RegisterFunction(string,Func)

Registers a new function that returns a value, which can be called from a Yarn program.

RegisterFunction(string,Func<T1, TResult>)

Registers a new function that returns a value, which can be called from a Yarn program.

RegisterFunction(string,Func<T1, T2, TResult>)

Registers a new function that returns a value, which can be called from a Yarn program.

RegisterFunction(string,Func<T1, T2, T3, TResult>)

Registers a new function that returns a value, which can be called from a Yarn program.

RegisterFunction(string,Func<T1, T2, T3, T4, TResult>)

Registers a new function that returns a value, which can be called from a Yarn program.

RegisterFunction(string,Func<T1, T2, T3, T4, T5, TResult>)

Registers a new function that returns a value, which can be called from a Yarn program.

DeregisterFunction(string)
FunctionExists(string)
Library
GetFunction(string)
ImportLibrary(Library)
Library
RegisterFunction(string,Delegate)

DeregisterFunction(string)

Method in Library

Summary

Removes a function from the Library.

public void DeregisterFunction(string name)

Remarks

If no function with the given name is present in the Library, this method does nothing.

Parameters

Name
Description

ImportLibrary(Library)

Method in

Summary

Loads functions from another .

string name

The name of the function to remove.

Remarks

If the other library contains a function with the same name as one in this library, the function in the other library takes precedence.

Parameters

Name
Description

otherLibrary

The library to import functions from.

public void ImportLibrary(Library otherLibrary)
Library
Library

RegisterFunction(string,Func<T1, T2, T3, T4, TResult>)

Method in Library

Summary

Registers a new function that returns a value, which can be called from a Yarn program.

public void RegisterFunction<T1, T2, T3, T4, TResult>(string name, Func<T1, T2, T3, T4, TResult> implementation)

Parameters

Name
Description

Type Parameters

Name
Description

RegisterFunction(string,Func<T1, T2, T3, T4, T5, TResult>)

Method in

Summary

Registers a new function that returns a value, which can be called from a Yarn program.

RegisterFunction(string,Func<T1, T2, TResult>)

Method in

Summary

Registers a new function that returns a value, which can be called from a Yarn program.

Yarn.Library

The type of the function's fourth argument.

string name

The name of the function.

System.Func<T1, T2, T3, T4, TResult> implementation

The method to be invoked when the function is called.

TResult

The return type of the function.

TResult

The return type of the function.

T1

The type of the function's first argument.

T2

The type of the function's second argument.

T3

The type of the function's third argument.

T4

Parameters
Name
Description

string name

The name of the function.

System.Func<T1, T2, TResult> implementation

The method to be invoked when the function is called.

Type Parameters

Name
Description

TResult

The return type of the function.

TResult

The return type of the function.

T1

The type of the function's first argument.

T2

The type of the function's second argument.

Library
public void RegisterFunction<T1, T2, TResult>(string name, Func<T1, T2, TResult> implementation)
Parameters
Name
Description

string name

The name of the function.

System.Func<T1, T2, T3, T4, T5, TResult> implementation

The method to be invoked when the function is called.

Type Parameters

Name
Description

TResult

The return type of the function.

TResult

The return type of the function.

T1

The type of the function's first argument.

T2

The type of the function's second argument.

T3

The type of the function's third argument.

Library

FunctionExists(string)

Method in Library

Summary

Gets a value indicating whether this Library contains a function named name .

public bool FunctionExists(string name)

Parameters

Name
Description

Returns

true if a function exists in this Library; false otherwise.

RegisterFunction(string,Func<TResult>)

Method in Library

Summary

Registers a new function that returns a value, which can be called from a Yarn program.

public void RegisterFunction<TResult>(string name, Func<TResult> implementation)

Parameters

Name
Description

Type Parameters

Name
Description

RegisterFunction(string,Func<T1, T2, T3, TResult>)

Method in

Summary

Registers a new function that returns a value, which can be called from a Yarn program.

RegisterFunction(string,Delegate)

Method in

Summary

Registers a new function that returns a value, which can be called from a Yarn program.

public void RegisterFunction<T1, T2, T3, T4, T5, TResult>(string name, Func<T1, T2, T3, T4, T5, TResult> implementation)

T4

The type of the function's fourth argument.

T5

The type of the function's fifth argument.

string name

The name of the function to look for.

string name

The name of the function.

System.Func<TResult> implementation

The method to be invoked when the function is called.

TResult

The return type of the function.

Parameters
Name
Description

string name

The name of the function.

System.Func<T1, T2, T3, TResult> implementation

The method to be invoked when the function is called.

Type Parameters

Name
Description

TResult

The return type of the function.

TResult

The return type of the function.

T1

The type of the function's first argument.

T2

The type of the function's second argument.

T3

The type of the function's third argument.

Library
Parameters
Name
Description

string name

The name of the function.

System.Delegate implementation

The method to be invoked when the function is called.

Type Parameters

Name
Description

TResult

The return type of the function.

public void RegisterFunction(string name, Delegate implementation)
Library
public void RegisterFunction<T1, T2, T3, TResult>(string name, Func<T1, T2, T3, TResult> implementation)

RegisterFunction(string,Func<T1, TResult>)

Method in

Summary

Registers a new function that returns a value, which can be called from a Yarn program.

Parameters
Name
Description

string name

The name of the function.

System.Func<T1, TResult> implementation

The method to be invoked when the function is called.

Type Parameters

Name
Description

TResult

The return type of the function.

TResult

The return type of the function.

T1

The type of the function's first argument.

Library
public void RegisterFunction<T1, TResult>(string name, Func<T1, TResult> implementation)