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)
            {
                TES5PropertiesFactory.CreateProperties(variableList, globalScope, globalVariables);
            }
            return(globalScope);
        }
Esempio n. 2
0
        public TES5GlobalScope Build(string sourcePath, TES5GlobalVariables globalVariables)
        {
            string scriptName     = Path.GetFileNameWithoutExtension(sourcePath);
            string referencesPath = Path.Combine(Path.GetDirectoryName(sourcePath), scriptName + ".references");
            //Create the header.
            TES5ScriptHeader            scriptHeader = new TES5ScriptHeader(scriptName, TES5BasicType.T_QUEST, "", true);
            TES5GlobalScope             globalScope  = new TES5GlobalScope(scriptHeader);
            TES4VariableDeclarationList variableList = FragmentsReferencesBuilder.buildVariableDeclarationList(referencesPath);

            if (variableList != null)
            {
                TES5PropertiesFactory.CreateProperties(variableList, globalScope, globalVariables);
            }
            return(globalScope);
        }