Example #1
0
        public static void GenerateLuaTableByExcel(string excelFloder, string luaFloder, int readMask = 0x7FFFFFFF)
        {
            if (!Directory.Exists(luaFloder))
            {
                Directory.CreateDirectory(luaFloder);
            }

            ReadALLExcelSheets(excelFloder);
            foreach (var excelSheet in mExcelSheetCaches.Values)
            {
                var    translator = new TranslatorTable(excelSheet, readMask);
                string path       = Path.Combine(luaFloder, translator.sheetName + ".lua");
                File.WriteAllBytes(path, UTF8Encoding.UTF8.GetBytes(translator.ToLuaTable()));
            }
        }
Example #2
0
        public static void GenerateBytesByExcel(string excelFloder, string bytesFloder, int readMask = 0x7FFFFFFF)
        {
            if (!Directory.Exists(bytesFloder))
            {
                Directory.CreateDirectory(bytesFloder);
            }

            ReadALLExcelSheets(excelFloder);
            foreach (var excelSheet in mExcelSheetCaches.Values)
            {
                var    translator = new TranslatorTable(excelSheet, readMask);
                string byte_path  = Path.Combine(bytesFloder, translator.sheetName + ".byte");
                File.WriteAllBytes(byte_path, translator.ToDataEntryBytes());
            }
        }
Example #3
0
        public static void GenerateEntryClassByExcel(string excelFloder, string codeFloder, int readMask = 0x7FFFFFFF)
        {
            if (!Directory.Exists(codeFloder))
            {
                Directory.CreateDirectory(codeFloder);
            }
            StringBuilder stringBuilder = new StringBuilder();

            ReadALLExcelSheets(excelFloder);
            foreach (var excelSheet in mExcelSheetCaches.Values)
            {
                stringBuilder.Clear();
                var    translator = new TranslatorTable(excelSheet, readMask);
                string path       = Path.Combine(codeFloder, translator.sheetName + ".cs");
                File.WriteAllBytes(path, UTF8Encoding.UTF8.GetBytes(translator.ToDataEntryClass()));
            }
        }
        public static string ToLuaLable(ExcelWorksheet excelSheet, int readMask)
        {
            TranslatorTable table = new TranslatorTable(excelSheet, readMask);

            return(table.ToLuaTable());
        }
        public static string ToLuaLable(byte[] bytes)
        {
            TranslatorTable table = new TranslatorTable(bytes);

            return(table.ToLuaTable());
        }
        public static DataEntryCache ToTableCache(ExcelWorksheet excelSheet, int readMask, Type type)
        {
            TranslatorTable table = new TranslatorTable(excelSheet, readMask);

            return(ToTableCache(table.ToDataEntryBytes(), type));
        }