using System; using System.Collections.Generic; using System.Linq; using System.Text; using LuaInterface; namespace BizHawk.Client.Common { public class LuaSandbox { protected static Action Logger; public static void SetLogger(Action logger) { Logger = logger; } public static void Sandbox(Action callback, Action exceptionCallback = null) { try { EnvironmentSandbox.Sandbox(callback); } catch (LuaException ex) { Logger(ex.ToString()); if (exceptionCallback != null) { exceptionCallback(); } } } } }