Exemple #1
0
        public static void RoundTripTest(string compressedString)
        {
            Directory.CreateDirectory("output");

            var wa = new WeakAura(compressedString);

            // var json = wa.ToString();
            var json = compressedString.DecompressToLuaTable().SerializeToString();

            File.WriteAllText("output/json.txt", json);
            Console.WriteLine("Json Generated");

            var code = wa.GenerateCode();

            File.WriteAllText("output/code.cs", code);
            Console.WriteLine("Code Generated");

            var tableClone = wa.ToLuaTable();
            var jsonClone  = tableClone.SerializeToString();

            File.WriteAllText("output/jsonClone.txt", jsonClone);
            Console.WriteLine("Json Clone Generated");

            var wa2 = wa.ToCompressedString();

            Console.WriteLine(wa2);
        }
Exemple #2
0
        private static void UnpackTest()
        {
            var wa    = new WeakAura(waTest);
            var table = wa.ToLuaTable().SerializeToString();
            var code  = wa.GenerateCode();

            Directory.CreateDirectory("output");
            const string filepath0 = "output/luaTable.txt";

            File.WriteAllText(filepath0, table);
            Console.WriteLine($"File '{filepath0}' written. {table.Length} bytes.");

            const string filepath1 = "output/code.txt";

            File.WriteAllText(filepath1, code);
            Console.WriteLine($"File '{filepath1}' written. {code.Length} bytes.");
        }