AcManager.Tools.Miscellaneous.LuaHelper.GetExtended C# (CSharp) Method

GetExtended() private method

private GetExtended ( ) : Script
return Script
        public static Script GetExtended() {
            try {
                if (!_registered) {
                    UserData.RegisterAssembly();
                    _registered = true;
                }

                var script = new Script();

                script.Globals["log"] = (Action<object[]>)Log;
                script.Globals["numutils"] = new Table(script) {
                    ["numvalue"] = (Func<string, double>)GetNumberValue
                };
                script.Globals["strutils"] = new Table(script) {
                    ["equals"] = (Func<string, string, bool>)CompareStrings,
                    ["equals_i"] = (Func<string, string, bool>)CompareStringsIgnoringCase
                };

                return script;
            } catch (Exception e) {
                Logging.Warning("Can’t initialize: " + e);
                return null;
            }
        }
    }