Class Script
- Namespace
- MoonSharp.Interpreter
- Assembly
- Assembly-CSharp.dll
public class Script : IScriptPrivateResource
- Inheritance
-
Script
- Implements
-
- Inherited Members
-
- Extension Methods
-
Constructors
Script()
Script(CoreModules)
public Script(CoreModules coreModules)
Parameters
coreModules CoreModules
Fields
LUA_VERSION
public const string LUA_VERSION = "5.2"
Field Value
- string
VERSION
public const string VERSION = "2.0.0.0"
Field Value
- string
Properties
DebuggerEnabled
public bool DebuggerEnabled { get; set; }
Property Value
- bool
DefaultOptions
public static ScriptOptions DefaultOptions { get; }
Property Value
- ScriptOptions
GlobalOptions
public static ScriptGlobalOptions GlobalOptions { get; }
Property Value
- ScriptGlobalOptions
Globals
public Table Globals { get; }
Property Value
- Table
Options
public ScriptOptions Options { get; }
Property Value
- ScriptOptions
public PerformanceStatistics PerformanceStats { get; }
Property Value
- PerformanceStatistics
Registry
public Table Registry { get; }
Property Value
- Table
SourceCodeCount
public int SourceCodeCount { get; }
Property Value
- int
Methods
AttachDebugger(IDebugger)
public void AttachDebugger(IDebugger debugger)
Parameters
debugger IDebugger
Call(DynValue)
public DynValue Call(DynValue function)
Parameters
function DynValue
Returns
- DynValue
Call(DynValue, params DynValue[])
public DynValue Call(DynValue function, params DynValue[] args)
Parameters
function DynValue
args DynValue[]
Returns
- DynValue
Call(DynValue, params object[])
public DynValue Call(DynValue function, params object[] args)
Parameters
function DynValue
args object[]
Returns
- DynValue
Call(object)
public DynValue Call(object function)
Parameters
function object
Returns
- DynValue
Call(object, params object[])
public DynValue Call(object function, params object[] args)
Parameters
function object
args object[]
Returns
- DynValue
CreateConstantDynamicExpression(string, DynValue)
public DynamicExpression CreateConstantDynamicExpression(string code, DynValue constant)
Parameters
code string
constant DynValue
Returns
- DynamicExpression
CreateCoroutine(DynValue)
public DynValue CreateCoroutine(DynValue function)
Parameters
function DynValue
Returns
- DynValue
CreateCoroutine(object)
public DynValue CreateCoroutine(object function)
Parameters
function object
Returns
- DynValue
CreateDynamicExpression(string)
public DynamicExpression CreateDynamicExpression(string code)
Parameters
code string
Returns
- DynamicExpression
DoFile(string, Table, string)
public DynValue DoFile(string filename, Table globalContext = null, string codeFriendlyName = null)
Parameters
filename string
globalContext Table
codeFriendlyName string
Returns
- DynValue
DoStream(Stream, Table, string)
public DynValue DoStream(Stream stream, Table globalContext = null, string codeFriendlyName = null)
Parameters
stream Stream
globalContext Table
codeFriendlyName string
Returns
- DynValue
DoString(string, Table, string)
public DynValue DoString(string code, Table globalContext = null, string codeFriendlyName = null)
Parameters
code string
globalContext Table
codeFriendlyName string
Returns
- DynValue
Dump(DynValue, Stream)
public void Dump(DynValue function, Stream stream)
Parameters
function DynValue
stream Stream
GetBanner(string)
public static string GetBanner(string subproduct = null)
Parameters
subproduct string
Returns
- string
GetSourceCode(int)
public SourceCode GetSourceCode(int sourceCodeID)
Parameters
sourceCodeID int
Returns
- SourceCode
public Table GetTypeMetatable(DataType type)
Parameters
type DataType
Returns
- Table
LoadFile(string, Table, string)
public DynValue LoadFile(string filename, Table globalContext = null, string friendlyFilename = null)
Parameters
filename string
globalContext Table
friendlyFilename string
Returns
- DynValue
LoadFunction(string, Table, string)
public DynValue LoadFunction(string code, Table globalTable = null, string funcFriendlyName = null)
Parameters
code string
globalTable Table
funcFriendlyName string
Returns
- DynValue
LoadStream(Stream, Table, string)
public DynValue LoadStream(Stream stream, Table globalTable = null, string codeFriendlyName = null)
Parameters
stream Stream
globalTable Table
codeFriendlyName string
Returns
- DynValue
LoadString(string, Table, string)
public DynValue LoadString(string code, Table globalTable = null, string codeFriendlyName = null)
Parameters
code string
globalTable Table
codeFriendlyName string
Returns
- DynValue
RequireModule(string, Table)
public DynValue RequireModule(string modname, Table globalContext = null)
Parameters
modname string
globalContext Table
Returns
- DynValue
RunFile(string)
public static DynValue RunFile(string filename)
Parameters
filename string
Returns
- DynValue
RunString(string)
public static DynValue RunString(string code)
Parameters
code string
Returns
- DynValue
public void SetTypeMetatable(DataType type, Table metatable)
Parameters
type DataType
metatable Table
WarmUp()
public static void WarmUp()