public override void PostProcessTableList(List <Table> table_list)
        {
            for (int i = 0; i < table_list.Count; i++)
            {
                table_list[i].keyList[0].keyType = KEY_TYPE.MAIN_KEY;
            }

            table_list.Add(LuaBuilder.SimplifiedTable(table_list[0]));
        }
Exemple #2
0
        public override string ConvertToClientLua(List <Table> table_list)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("return {\n");
            for (int i = 0; i < table_list.Count; ++i)
            {
                string lua_table = LuaBuilder.GetLuaTable(table_list[i]);
                if (!string.IsNullOrEmpty(lua_table))
                {
                    builder.Append(lua_table);
                    builder.Append(i != table_list.Count - 1 ? ",\n\n" : "");
                }
            }
            builder.Append("\n\n}");
            return(builder.ToString());
        }
Exemple #3
0
        public override void PostProcessTableList(List <Table> table_list)
        {
            // combine table
            {
                List <List <object> > item_list = table_list[0].itemList;
                for (int i = 1; i < table_list.Count; i++)
                {
                    List <List <object> > temp_item_list = table_list[i].itemList;
                    for (int j = 0; j < temp_item_list.Count; ++j)
                    {
                        item_list.Add(temp_item_list[j]);
                    }
                }

                while (table_list.Count > 1)
                {
                    table_list.RemoveAt(table_list.Count - 1);
                }

                table_list[0].tableType          = TABLE_TYPE.LIST;
                table_list[0].keyList[0].keyType = KEY_TYPE.MAIN_KEY;
            }

            // handle default table
            {
                Table default_table = LuaBuilder.SimplifiedTable(table_list[0]);
                default_table.tableType = TABLE_TYPE.SIMPLE;
                default_table.name      = "default_table";

                KeyT key_T = new KeyT();
                key_T.outFlag = "";
                key_T.key     = "default_table";
                key_T.keyType = KEY_TYPE.MAIN_KEY;
                default_table.keyList.Add(key_T);

                table_list.Add(default_table);
            }
        }
Exemple #4
0
 public virtual void PostProcessTableList(List <Table> table_list)
 {
     LuaBuilder.SimplifiedTableList(table_list);
 }