Пример #1
0
        public static ContentFile FromInibin(Inibin source, ContentConfiguration configuration)
        {
            var result = new ContentFile();

            result.Values               = configuration.Converter.Convert(source);
            result.Id                   = configuration.FindId(source.FilePath);
            result.Name                 = configuration.FindName(result);
            result.ResourcePath         = source.FilePath;
            result.ContentFormatVersion = 4;
            return(result);
        }
 public int ContentDataMake(string listFile, string outpudir = "ExportOutput",
                            string mapDir = "ConversionMaps", string patternDir = "ContentPatterns")
 {
     try
     {
         var localization = FontConfigFile.Load(_manager, "en_US");
         var exporter     = new InibinExporter(_manager, outpudir);
         exporter.Export(ContentConfiguration.LoadList(localization, mapDir, patternDir, listFile));
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
     return(0);
 }
        public static ContentConfiguration[] LoadList(FontConfigFile localization,
                                                      string mapDir, string patternDir, string listFile)
        {
            var list      = new List <ContentConfiguration>();
            var data      = File.ReadAllText(listFile);
            var entryList = JsonConvert.DeserializeObject <List <ContentConfigurationListEntry> >(data);

            foreach (var entry in entryList)
            {
                list.Add(ContentConfiguration.Load(localization,
                                                   string.Format("{0}/{1}", patternDir, entry.Pattern),
                                                   string.Format("{0}/{1}", mapDir, entry.ConversionMap),
                                                   entry.InputPattern,
                                                   entry.OutputPattern));
            }
            return(list.ToArray());
        }