Пример #1
0
        public override void Import(IFile fileSystem, string rootPath)
        {
            string importPath = GetFolder(rootPath);

            string importFilePath = System.IO.Path.Combine(importPath, INDEX_FILE_NAME);
            string fontIndexListJson = fileSystem.ReadText(importFilePath);
            _data = JsonConvert.DeserializeObject<Data>(fontIndexListJson);

            foreach(int fontIndex in _data.fontIndexList)
            {
                string elementPath = System.IO.Path.Combine(importPath, fontIndex.ToString());
                string fontElementJson = fileSystem.ReadText(elementPath);
                FontElement fontElement = JsonConvert.DeserializeObject<FontElement>(fontElementJson);
                _fontElementList.Add(fontElement);
            }
        }
Пример #2
0
        public override void Import(IFile fileSystem, string rootPath)
        {
            string importRoot = GetFolder(rootPath);
            string importFilePath = System.IO.Path.Combine(importRoot, INDEX_FILENAME);
            string content = fileSystem.ReadText(importFilePath);

            _data = JsonConvert.DeserializeObject<Data>(content);
        }
Пример #3
0
        public void Import(IFile fileSystem,
                           string extraFontFolderPath,
                           string indexFilename)
        {
            string indexPath = System.IO.Path.Combine(extraFontFolderPath, indexFilename);
            string indexJsonContent = fileSystem.ReadText(indexPath);

            List<int> extraFontIndexList = new List<int> { 2 };
            patchDict = new Dictionary<int, Font.FontElement>();

            foreach (int exfontIndex in extraFontIndexList)
            {
                string exfontFilePath = System.IO.Path.Combine(extraFontFolderPath, exfontIndex.ToString());
                string exfontContent = fileSystem.ReadText(exfontFilePath);
                Font.FontElement fontElement = JsonConvert.DeserializeObject<Font.FontElement>(exfontContent);
                patchDict.Add(exfontIndex, fontElement);
            }
        }
Пример #4
0
        public override void Import(IFile fileSystem, string rootPath)
        {
            string folderPath = GetFolder(rootPath);
            string indexFullPath = System.IO.Path.Combine(folderPath, INDEX_FILENAME);
            string jsonContent = fileSystem.ReadText(indexFullPath);
            _data = JsonConvert.DeserializeObject<Data>(jsonContent);

            foreach(var textureFilename in _data.exportedImageNameList)
            {
                elementList.Add(fileSystem.ReadBinary(System.IO.Path.Combine(folderPath, textureFilename)));
            }
        }
Пример #5
0
        public override void Import(IFile fileSystem, string rootPath)
        {
            string folderPath = GetFolder(rootPath);
            string indexFullPath = System.IO.Path.Combine(folderPath, INDEX_FILENAME);
            string stringList = fileSystem.ReadText(indexFullPath);

            string[] lines = stringList.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
            for(int i = 0; i < lines.Length;i++)
            {
                _data.stringList.Add(new StringEntry() { index = i, content = lines[i] });
            }
        }
Пример #6
0
        public override void Import(IFile fileSystem, string rootPath)
        {
            string importPath = GetFolder(rootPath);
            string indexFilePath = System.IO.Path.Combine(importPath, INDEX_FILENAME);
            string indexString = fileSystem.ReadText(indexFilePath);
            _data = JsonConvert.DeserializeObject<Data>(indexString);

            foreach(var filename in _data.audioFileNameList)
            {
                string audioPath = System.IO.Path.Combine(importPath, filename);
                audioList.Add(fileSystem.ReadBinary(audioPath));
            }
        }
Пример #7
0
        public override void Import(IFile fileSystem, string rootPath)
        {
            string folderPath = GetFolder(rootPath);
            string indexFilePath = System.IO.Path.Combine(folderPath, GetIndexFilename());
            string indexJson = fileSystem.ReadText(indexFilePath);
            List<NamedElementFilename> namedElementFilenameList = JsonConvert.DeserializeObject<List<NamedElementFilename>>(indexJson);

            foreach (var namedElementFilename in namedElementFilenameList)
            {
                string filePath = System.IO.Path.Combine(folderPath, namedElementFilename.filename);
                elementList.Add
                (
                    new NamedElement
                    {
                        name = namedElementFilename.name,
                        content = fileSystem.ReadBinary(filePath)
                    }
                );
            }
        }