tables.sbn 863 B

1234567891011121314151617181920212223242526272829303132
  1. using Luban;
  2. using System.Text.Json;
  3. {{namespace_with_grace_begin __namespace}}
  4. public partial class {{__name}}
  5. {
  6. {{~for table in __tables ~}}
  7. {{~if table.comment != '' ~}}
  8. /// <summary>
  9. /// {{escape_comment table.comment}}
  10. /// </summary>
  11. {{~end~}}
  12. public {{table.full_name}} {{format_property_name __code_style table.name}} {get; }
  13. {{~end~}}
  14. public {{__name}}(System.Func<string, JsonElement> loader)
  15. {
  16. {{~for table in __tables ~}}
  17. {{format_property_name __code_style table.name}} = new {{table.full_name}}(loader("{{table.output_data_file}}"));
  18. {{~end~}}
  19. ResolveRef();
  20. }
  21. private void ResolveRef()
  22. {
  23. {{~for table in __tables ~}}
  24. {{format_property_name __code_style table.name}}.ResolveRef(this);
  25. {{~end~}}
  26. }
  27. }
  28. {{namespace_with_grace_end __namespace}}