/// <summary> /// Creates a new LuaEnvironment without initializing the state, for use with a derived type. /// </summary> protected LuaEnvironmentNet() { _compiler = new CodeCompiler(); _parser = new PlainParser(); _runtime = LuaRuntimeNet.Create(this); Settings = new LuaSettings().AsReadOnly(); _globals = new LuaValues.LuaTable(); _modules = new ModuleBinder(); }
/// <summary> /// Creates a new environment with the given settings. /// </summary> /// <param name="settings">The settings to give the Environment.</param> /// <exception cref="System.ArgumentNullException">If settings is null.</exception> public LuaEnvironmentNet(LuaSettings settings) { if (settings == null) { throw new ArgumentNullException(nameof(settings)); } _globals = new LuaTable(); _runtime = LuaRuntimeNet.Create(this); _compiler = new CodeCompiler(); _parser = new PlainParser(); _modules = new ModuleBinder(); Settings = settings.AsReadOnly(); // initialize the global variables. LuaStaticLibraries.Initialize(this); _initializeTypes(); }