This commit is contained in:
PC-20230316NUNE\Administrator
2024-10-16 20:41:40 +08:00
parent 44c3ea001a
commit 6da2f9e691
1866 changed files with 36068 additions and 25732 deletions

View File

@@ -0,0 +1,37 @@
using Cysharp.Threading.Tasks;
using Luban;
using SimpleJSON;
{{namespace_with_grace_begin __namespace}}
public partial class {{__name}}
{
{{~for table in __tables ~}}
{{~if table.comment != '' ~}}
/// <summary>
/// {{escape_comment table.comment}}
/// </summary>
{{~end~}}
public {{table.full_name}} {{format_property_name __code_style table.name}} { get; private set; }
{{~end~}}
public readonly int Count = {{ __tables | array.size }};
public Tables() { }
public async UniTask LoadAsync(System.Func<string, UniTask<ByteBuf>> loader)
{
{{~for table in __tables ~}}
{{format_property_name __code_style table.name}} = new {{table.full_name}}(await loader("{{table.output_data_file}}"));
{{~end~}}
ResolveRef();
}
private void ResolveRef()
{
{{~for table in __tables ~}}
{{format_property_name __code_style table.name}}.ResolveRef(this);
{{~end~}}
}
}
{{namespace_with_grace_end __namespace}}