Inheritance: FileData, IModuleFileData
コード例 #1
0
        public void TryLoad()
        {
            IModuleFileData fileData = null;

            // only load Json
            if (mType == FileType.JSON)
            {
                fileData = new JsonFileData(ResolvedPath);
            }
            else if (mType == FileType.LUA)
            {
                fileData = new LuaFileData(ResolvedPath);
            }

            if (fileData != null)
            {
                fileData.SetModuleFile(this);
                mFileData = fileData as FileData;
                mFileData.Load();

                if (mAlias == "ui:stockpile:filters")
                {
                    foreach (JToken filter in (mFileData as JsonFileData).Json.SelectTokens("stockpile.*.categories.*.filter"))
                    {
                        ModuleDataManager.GetInstance().StockpileFilters.Add(filter.ToString());
                    }
                }

                foreach (KeyValuePair <string, FileData> data in mReferencesCache)
                {
                    mFileData.ReferencedByFileData[data.Key] = data.Value;
                }
            }
        }
コード例 #2
0
        public void TryLoad()
        {
            IModuleFileData fileData = null;

            // only load Json
            if (mType == FileType.JSON)
            {
                fileData = new JsonFileData(ResolvedPath);
            }
            else if (mType == FileType.LUA)
            {
                fileData = new LuaFileData(ResolvedPath);
            }

            if (fileData != null)
            {
                fileData.SetModuleFile(this);
                mFileData = fileData as FileData;
                mFileData.Load();

                if (mAlias == "ui:stockpile:filters")
                {
                    foreach (JToken filter in (mFileData as JsonFileData).Json.SelectTokens("stockpile.*.categories.*.filter"))
                    {
                        ModuleDataManager.GetInstance().StockpileFilters.Add(filter.ToString());
                    }
                }

                foreach (KeyValuePair<string, FileData> data in mReferencesCache)
                {
                    mFileData.ReferencedByFileData[data.Key] = data.Value;
                }
            }
        }
コード例 #3
0
        public void TryLoad()
        {
            IModuleFileData fileData = null;

            // only load Json
            if (mType == FileType.JSON)
            {
                fileData = new JsonFileData(ResolvedPath);
            }
            else if (mType == FileType.LUA)
            {
                fileData = new LuaFileData(ResolvedPath);
            }

            if (fileData != null)
            {
                fileData.SetModuleFile(this);
                mFileData = fileData as FileData;
                mFileData.Load();
                foreach (KeyValuePair <string, FileData> data in mReferencesCache)
                {
                    mFileData.ReferencedByFileData[data.Key] = data.Value;
                }
            }
        }