%%---------------------------------------------------- %% 数据配置文件 %% @author %%---------------------------------------------------- -module(world_lev_data). -export([cfg/0]). -include("data_config.hrl"). -include("common.hrl"). cfg() -> #data_cfg{ name = world_lev_data ,lua_name = world_lev_data ,desc = "配置数据" ,source = "world_lev_data.xml" ,target = "world_lev_data.erl" ,inc = [] ,callback = [ {{get_const, undefined}, cb_fun, handle, {get_fun, ["常量配置"], "get_const(~ts) -> ~ts; %% ~ts", [key, val, desc]}} ,{list_rank, [{data_reverse, true}], cb_fun, handle, {tuple_list, ["计算配置"], all}} %% ,{{rank_val, 0}, cb_fun, handle, {get_fun, ["计算配置"], "rank_val(Rank) when Rank >= ~ts andalso Rank =< ~ts -> ~ts;", [min, max, val]}} %% ,{{get, 0}, cb_fun, handle, {get_fun, ["DATA"], "get(DiffLev) when DiffLev >= ~ts andalso DiffLev =< ~ts -> ~ts;", [min_lev, max_lev, {rec, new_map, all}]}} ] ,callback_cli = [ {const, cb_fun_lua, handle, {key_val, ["常量配置"], [key], all}} %% ,{get, cb_fun_lua, handle, {fun_format, ["DATA"], "if v >= ~ts and v <= ~ts then return ~ts end", [min_lev, max_lev, all]}} ] ,callback_json = [ {const, cb_fun_json, handle, {key_val, ["常量配置"], [key], all}} %% ,{get, cb_fun_lua, handle, {fun_format, ["DATA"], "if v >= ~ts and v <= ~ts then return ~ts end", [min_lev, max_lev, all]}} ] ,sheet = [ {["常量配置"], [ #f_column{type = atom, name = key, desc = "键", primary = true, mod = all} ,#f_column{type = term, name = val, desc = "值", add_list_sign=false, mod = all} ,#f_column{type = str, name = desc, desc = "描述", mod = all} ]} ,{["计算配置"], [ #f_column{type = int, name = min, desc = "排名上限", mod = all} ,#f_column{type = int, name = max, desc = "排名下限", mod = all} ,#f_column{type = int, name = val, desc = "权重", mod = all} ]} ] }.