C# Class LuaSharp.Lua

Represents a Lua state.
A Lua state is akin to an AppDomain in .Net.
Inheritance: IDisposable
Mostra file Open project: jsimmons/LuaSharp Class Usage Examples

Public Methods

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

Protected Methods

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

Method Details

CreateTable() public method

Creates a new table in the state.
public CreateTable ( ) : LuaSharp.LuaTable
return LuaSharp.LuaTable

CreateTable() public method

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. ///
return LuaSharp.LuaTable

Dispose() public method

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
return void

Dispose() protected method

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
return void

DoFile() public method

Executes the code contained in a file.
public DoFile ( string filename ) : void
filename string /// A containing the path to the file. ///
return void

DoString() public method

Executes a literal chunk of Lua code.
public DoString ( string chunk ) : void
chunk string /// A that containes the chunk to execute. ///
return void

GetValue() public method

Returns the value at the given path.
public GetValue ( ) : object
return object

Lua() public method

Creates a new instance of the Lua class.
public Lua ( ) : System
return System

SetLibraryPath() public method

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. ///
return void

SetValue() public method

Sets the object at path defined by fragments to the object o.
public SetValue ( object o ) : void
o object /// A the object to set. ///
return void

this() public method

Gets or sets the a Lua object with the specified path.
public this ( ) : object
return object