C# Класс LuaSharp.Lua

Represents a Lua state.
A Lua state is akin to an AppDomain in .Net.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
CreateTable ( ) : LuaSharp.LuaTable

Creates a new table in the state.

CreateTable ( int initialArrayCapacity, int initialNonArrayCapacity ) : LuaSharp.LuaTable

Creates the table.

Dispose ( ) : void

Releases all resource used by the LuaSharp.Lua object.

Call Dispose when you are finished using the LuaSharp.Lua. The Dispose method leaves the LuaSharp.Lua in an unusable state. After calling Dispose, you must release all references to the LuaSharp.Lua so the garbage collector can reclaim the memory that the LuaSharp.Lua was occupying.

DoFile ( string filename ) : void

Executes the code contained in a file.

DoString ( string chunk ) : void

Executes a literal chunk of Lua code.

GetValue ( ) : object

Returns the value at the given path.

Lua ( ) : System

Creates a new instance of the Lua class.

SetLibraryPath ( string path ) : void

Sets the path where the Lua state looks for `requires` files.

Paths should be separated by a semicolon, and contain a single question mark `?` where the name of the required library should be substituted.

SetValue ( object o ) : void

Sets the object at path defined by fragments to the object o.

this ( ) : object

Gets or sets the a Lua object with the specified path.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Releases all resource used by the LuaSharp.Lua object.

Call Dispose when you are finished using the LuaSharp.Lua. The Dispose method leaves the LuaSharp.Lua in an unusable state. After calling Dispose, you must release all references to the LuaSharp.Lua so the garbage collector can reclaim the memory that the LuaSharp.Lua was occupying.

Описание методов

CreateTable() публичный Метод

Creates a new table in the state.
public CreateTable ( ) : LuaSharp.LuaTable
Результат LuaSharp.LuaTable

CreateTable() публичный Метод

Creates the table.
/// Is thrown when an argument passed to a method is invalid because it is . ///
public CreateTable ( int initialArrayCapacity, int initialNonArrayCapacity ) : LuaSharp.LuaTable
initialArrayCapacity int /// The initial capacity for array elements. ///
initialNonArrayCapacity int /// THe initial capacity for non-array elements. ///
Результат LuaSharp.LuaTable

Dispose() публичный Метод

Releases all resource used by the LuaSharp.Lua object.
Call Dispose when you are finished using the LuaSharp.Lua. The Dispose method leaves the LuaSharp.Lua in an unusable state. After calling Dispose, you must release all references to the LuaSharp.Lua so the garbage collector can reclaim the memory that the LuaSharp.Lua was occupying.
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

Releases all resource used by the LuaSharp.Lua object.
Call Dispose when you are finished using the LuaSharp.Lua. The Dispose method leaves the LuaSharp.Lua in an unusable state. After calling Dispose, you must release all references to the LuaSharp.Lua so the garbage collector can reclaim the memory that the LuaSharp.Lua was occupying.
protected Dispose ( bool disposing ) : void
disposing bool
Результат void

DoFile() публичный Метод

Executes the code contained in a file.
public DoFile ( string filename ) : void
filename string /// A containing the path to the file. ///
Результат void

DoString() публичный Метод

Executes a literal chunk of Lua code.
public DoString ( string chunk ) : void
chunk string /// A that containes the chunk to execute. ///
Результат void

GetValue() публичный Метод

Returns the value at the given path.
public GetValue ( ) : object
Результат object

Lua() публичный Метод

Creates a new instance of the Lua class.
public Lua ( ) : System
Результат System

SetLibraryPath() публичный Метод

Sets the path where the Lua state looks for `requires` files.
Paths should be separated by a semicolon, and contain a single question mark `?` where the name of the required library should be substituted.
public SetLibraryPath ( string path ) : void
path string /// The library path. ///
Результат void

SetValue() публичный Метод

Sets the object at path defined by fragments to the object o.
public SetValue ( object o ) : void
o object /// A the object to set. ///
Результат void

this() публичный Метод

Gets or sets the a Lua object with the specified path.
public this ( ) : object
Результат object