using MoonSharp.Interpreter;
namespace Fungus
{
///
/// Wrapper for a MoonSharp Lua Script instance.
///
public interface ILuaEnvironment
{
///
/// Initialise the Lua interpreter so we can start running Lua code.
///
void InitEnvironment();
///
/// The MoonSharp interpreter instance used to run Lua code.
///
Script Interpreter { get; }
///
/// Loads and compiles a string containing Lua script, returning a closure (Lua function) which can be executed later.
/// The Lua code to be run.
/// A descriptive name to be used in error reports.
///
Closure LoadLuaFunction(string luaString, string friendlyName);
///
/// Load and run a previously compiled Lua script. May be run as a coroutine.
/// A previously compiled Lua function.
/// Run the Lua code as a coroutine to support asynchronous operations.
/// Method to callback when the Lua code finishes exection. Supports return parameters.
///
void RunLuaFunction(Closure fn, bool runAsCoroutine, System.Action onComplete = null);
///
/// Load and run a string containing Lua script. May be run as a coroutine.
/// The Lua code to be run.
/// A descriptive name to be used in error reports.
/// Run the Lua code as a coroutine to support asynchronous operations.
/// Method to callback when the Lua code finishes exection. Supports return parameters.
///
void DoLuaString(string luaString, string friendlyName, bool runAsCoroutine, System.Action onComplete = null);
}
}