IndieGame/config/Table/Tools/Luban/Templates/flatbuffers/schema.sbn

52 lines
1.3 KiB
Plaintext
Raw Normal View History

2024-10-11 10:12:15 +08:00
namespace {{__namespace}};
{{~for enum in __enums
typeName = full_name enum
~}}
enum {{typeName}}:int {
{{~if !enum.has_zero_value_item~}}
__GENERATE_DEFAULT_VALUE = 0,
{{~end~}}
{{~for item in enum.items ~}}
{{typeName}}_{{item.name}} = {{item.int_value}},
{{~end~}}
}
{{~end~}}
{{~for bean in __beans~}}
{{~if bean.is_abstract_type ~}}
union {{full_name bean}} {
{{~for c in bean.hierarchy_not_abstract_children~}}
{{full_name c}},
{{~end~}}
}
{{~end~}}
{{~end~}}
{{~for bean in __beans~}}
{{~if !bean.is_abstract_type ~}}
table {{full_name bean}} {
{{~for f in bean.hierarchy_export_fields ~}}
{{f.name}}:{{declaring_type_name f.ctype}}{{type_metadata f.ctype}};
{{~end~}}
}
{{~end~}}
{{~end~}}
{{~for map in __maps~}}
table KeyValue_{{declaring_type_name map.key_type}}_{{declaring_type_name map.value_type}} {
key: {{declaring_type_name map.key_type}}{{type_metadata map.key_type}};
value: {{declaring_type_name map.value_type}}{{type_metadata map.value_type}};
}
{{~end~}}
{{~for table in __tables~}}
table {{full_name table}} {
// WARN! The name 'data_list' is used by FlatBuffersJsonExporter. don't modify it!
data_list:[{{declaring_type_name table.value_ttype}}](required);
}
root_type {{full_name table}};
{{~end~}}