Beispiel #1
0
        void CreateFrameworks()
        {
            FrameworkCreation frame = new FrameworkCreation();

            common.SetDefaultScreenResolution(frame.DefaultScreenResolution);

            try
            {
                frame = XmlHelper.DeserializeContent <FrameworkCreation>("Eon.Engine");
            }
            catch
            {
                new Error("Their was no Eon.Engine file found.", Seriousness.CriticalError);
                new Error("Unable to create any engine components.", Seriousness.CriticalError);
            }

            if (frame.AssemblyRefferences.Length > 0)
            {
                for (int i = 0; i < frame.AssemblyRefferences.Length; i++)
                {
                    try
                    {
                        AssemblyManager.AddAssemblyRef(frame.AssemblyRefferences[i]);
                    }
                    catch
                    {
                        new Error("Their was a problem finding " + frame.AssemblyRefferences[i], Seriousness.Error);
                    }
                }
            }
            else
            {
                new Error("Their were no assembly references found.", Seriousness.CriticalError);
            }

            foreach (string s in frame.EngineComponents)
            {
                object obj = AssemblyManager.CreateInstance(s);

                if (obj == null)
                {
                    new Error("The following component has not been created: " + s, Seriousness.Error);
                }
            }

            new DictionaryManager(frame.DefaultLanguage);

            if (frame.DictionaryFilepaths.Length > 0)
            {
                for (int i = 0; i < frame.DictionaryFilepaths.Length; i++)
                {
                    bool loaded = DictionaryManager.LoadDictionary(frame.DictionaryFilepaths[i]);

                    if (loaded == false)
                    {
                        new Error("Failed to load: " + frame.DictionaryFilepaths[i], Seriousness.CriticalError);
                    }
                }
            }
        }
Beispiel #2
0
        void CreateFrameworks()
        {
            try
            {
                FrameworkCreation frame = Common.ContentManager.Load <FrameworkCreation>("Eon");

                foreach (string s in frame.AssemblyRefferences)
                {
                    AssemblyManager.AddAssemblyRef(s);
                }

                foreach (string s in frame.EngineComponents)
                {
                    object obj = AssemblyManager.CreateInstance(s);

                    if (obj == null)
                    {
                        new Error("The following component has not been created: " + s, Seriousness.Error);
                    }
                }
            }
            catch (Exception ex)
            {
                new Error("Their was no Eon.ini file found.", Seriousness.CriticalError);
                new Error("Unable to create any engine components.", Seriousness.CriticalError);
            }
        }