引入luban配表 需要命令行 npm install buffer

This commit is contained in:
2025-08-12 15:01:59 +08:00
parent dad0f47974
commit af96a12845
166 changed files with 15164 additions and 41 deletions
@@ -0,0 +1,39 @@
{{~if __namespace != ''~}}
package {{__namespace}};
{{~end~}}
import luban.*;
import com.google.gson.JsonElement;
{{~
func get_table_inner_name
ret '_' + ($0 | string.downcase)
end
~}}
public final class {{__name}}
{
public interface IJsonLoader {
JsonElement load(String file) throws java.io.IOException;
}
{{~for table in __tables
inner_name = get_table_inner_name table.name
~}}
{{~if table.comment != '' ~}}
/**
* {{escape_comment table.comment}}
*/
{{~end~}}
private final {{table.full_name_with_top_module}} {{inner_name}};
public {{table.full_name_with_top_module}} get{{table.name}}() { return {{inner_name}}; }
{{~end~}}
public {{__name}}(IJsonLoader loader) throws java.io.IOException {
{{~for table in __tables
inner_name = get_table_inner_name table.name
~}}
{{inner_name}} = new {{table.full_name_with_top_module}}(loader.load("{{table.output_data_file}}"));
{{~end~}}
}
}