Пример #1
0
        private void LoadFromDefaults()
        {
            this.ClearData();

            this.Generic = Defaults.GetDefaultGeneric();

            foreach (D3Class @class in Defaults.GetDefaultClasses())
            {
                this.classes.Add(@class);
            }
        }
Пример #2
0
        private bool LoadFromPath(CarbonDirectory path)
        {
            this.ClearData();

            this.Generic = JsonExtensions.LoadFromFile<D3Generic>(path.ToFile(FileGeneric), false);

            CarbonFileResult[] files = path.GetFiles("*" + ExtensionClass);
            foreach (CarbonFileResult file in files)
            {
                try
                {
                    var @class = JsonExtensions.LoadFromFile<D3Class>(file.Absolute, false);
                    this.classes.Add(@class);
                }
                catch (Exception e)
                {
                    Diagnostic.Error("Could not load class definition from {0}: {1}", file, e);
                    return false;
                }
            }

            return true;
        }