public TES5GlobalScope Build(string scriptPath, TES5GlobalVariables globalVariables)
        {
            TES4Script                  parsedScript = this.standaloneParsingService.ParseOrGetFromCache(scriptPath);
            TES5ScriptHeader            scriptHeader = this.CreateHeader(parsedScript);
            TES4VariableDeclarationList?variableList = parsedScript.VariableDeclarationList;
            TES5GlobalScope             globalScope  = new TES5GlobalScope(scriptHeader);

            if (variableList != null)
            {
                propertyFactory.CreateAndAddProperties(variableList, globalScope, globalVariables);
            }
            return(globalScope);
        }
Example #2
0
        public TES5GlobalScope Build(string sourcePath, TES5GlobalVariables globalVariables)
        {
            string scriptName = Path.GetFileNameWithoutExtension(sourcePath);
            TES4VariableDeclarationList variableList = fragmentsReferencesBuilder.BuildVariableDeclarationList(sourcePath, scriptName, fragmentType);
            //Create the header.
            TES5ScriptHeader scriptHeader = TES5ScriptHeaderFactory.GetFromCacheOrConstructByBasicType(scriptName, scriptType, scriptNamePrefix, true);
            TES5GlobalScope  globalScope  = new TES5GlobalScope(scriptHeader);

            if (variableList != null)
            {
                propertyFactory.CreateAndAddProperties(variableList, globalScope, globalVariables);
            }
            return(globalScope);
        }