Example #1
0
        public NDBData LoadData(string path)
        {
            if (cachedDataDic.TryGetValue(path, out var data))
            {
                return(data);
            }

            data = LoadDataInternal(path);
            if (data == null)
            {
                throw new Exception();
            }

            if (languageData != null)
            {
                data.SetText(languageData);
            }
            else
            {
                string  textFilePath = textPathGetterFunc(path);
                NDBData textData     = LoadDataInternal(textFilePath);
                if (textData != null)
                {
                    data.SetText(textData);
                }
            }

            return(data);
        }
Example #2
0
 public void SetLanguageData(string path)
 {
     languageData = LoadDataInternal(path);
     foreach (var kvp in cachedDataDic)
     {
         kvp.Value.SetText(languageData);
     }
 }
Example #3
0
        private NDBData LoadDataInternal(string path)
        {
            byte[] fileBytes = bytesLoaderFunc(path);
            if (fileBytes == null || fileBytes.Length == 0)
            {
                return(null);
            }
            NDBData data = new NDBData(path);

            data.SetData(fileBytes);

            return(data);
        }
Example #4
0
 public void SetText(NDBData text)
 {
     textData = text;
 }
Example #5
0
 public void SetText(byte[] textBytes)
 {
     textData = new NDBData($"{Name}(text)");
     textData.SetData(textBytes);
 }