Files
TEngine/Luban/CustomTemplate_Client_LazyLoad/config/cs_bin/tables.tpl
ALEXTANG e071c20214 拓展自定义鲁班加载配置,支持懒加载 默认使用懒加载,未使用的配置不会载入内存
拓展自定义鲁班加载配置,支持懒加载 默认使用懒加载,未使用的配置不会载入内存
2023-08-17 23:07:07 +08:00

40 lines
971 B
Smarty

using Bright.Serialization;
{{
name = x.name
namespace = x.namespace
tables = x.tables
}}
namespace {{namespace}}
{
public partial class {{name}}
{
{{~for table in tables ~}}
{{~if table.comment != '' ~}}
/// <summary>
/// {{table.escape_comment}}
/// </summary>
{{~end~}}
public {{table.full_name}} {{table.name}} {get; }
{{~end~}}
public {{name}}(System.Func<string, ByteBuf> idxLoader,System.Func<string, ByteBuf> dataLoader)
{
var tables = new System.Collections.Generic.Dictionary<string, object>();
{{~for table in tables ~}}
{{table.name}} = new {{table.full_name}}(idxLoader("{{table.output_data_file}}"),"{{table.output_data_file}}",dataLoader);
tables.Add("{{table.full_name}}", {{table.name}});
{{~end~}}
PostInit();
{{~for table in tables ~}}
{{table.name}}.CacheTables(tables);
{{~end~}}
}
partial void PostInit();
}
}