跳到主要内容

setup

初始化属性计算模块

声明

bool setup(map total_calculator_attrib_dict, map total_calculator_attrib_sources_dict = nil, string attrib_calculation_unit_path = nil)

参数

参数名描述
total_calculator_attrib_dict待创建的属性计算器词典
{ "user" : { "hp" : false, "discount" : true, ... }, ... }
key: 计算器id
value: 属性词典
key: 属性名称
value: true(数值是float类型), false(数值是int类型)
total_calculator_attrib_sources_dict属性计算器的属性加成来源表
{ "user" : { "weapon" : (: get_weapon_improvement :), "armor" : (: get_armor_improvement :), ... }, ... }
或者
[ "user", ... ]
key: 计算器id
value: 属性采集来源列表或者词典
map类型:
key: 来源名称
value: 采集函数
array类型: 来源列表
attrib_calculation_unit_path属性计算单元的目录

返回值

true: 成功, false: 失败

使用方式

返回文档