Exemple #1
0
        private void CompileDelayedModules(ExternalLibraryDef library)
        {
            foreach (var scriptFile in _delayLoadedScripts)
            {
                if (scriptFile.asClass)
                {
                    library.AddClass(scriptFile.identifier, scriptFile.path);
                }
                else
                {
                    var module = library.AddModule(scriptFile.identifier, scriptFile.path);
                }
            }

            library.Modules.ForEach(moduleFile =>
            {
                var image        = CompileFile(moduleFile.FilePath);
                moduleFile.Image = image;
            });

            library.Classes.ForEach(classFile =>
            {
                var image = CompileFile(classFile.FilePath);
                _engine.AttachedScriptsFactory.LoadAndRegister(classFile.Symbol, image);
                classFile.Image = image;
            });

            _env.InitExternalLibrary(_engine, library);
        }