mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
Start TEngine3.0
Start TEngine3.0
This commit is contained in:
33
Luban/Luban.ClientServer/Templates/config/cpp_bin/tables.tpl
Normal file
33
Luban/Luban.ClientServer/Templates/config/cpp_bin/tables.tpl
Normal file
@@ -0,0 +1,33 @@
|
||||
{{~
|
||||
tables = x.tables
|
||||
name = x.name
|
||||
~}}
|
||||
class {{name}}
|
||||
{
|
||||
public:
|
||||
{{~for table in tables ~}}
|
||||
{{~if table.comment != '' ~}}
|
||||
/**
|
||||
* {{table.escape_comment}}
|
||||
*/
|
||||
{{~end~}}
|
||||
{{table.cpp_full_name}} {{table.name}};
|
||||
{{~end~}}
|
||||
|
||||
bool load(::bright::Loader<ByteBuf> loader)
|
||||
{
|
||||
::bright::HashMap<::bright::String, void*> __tables__;
|
||||
|
||||
ByteBuf buf;
|
||||
{{~for table in tables~}}
|
||||
if (!loader(buf, "{{table.output_data_file}}")) return false;
|
||||
if (!{{table.name}}.load(buf)) return false;
|
||||
__tables__["{{table.full_name}}"] = &{{table.name}};
|
||||
{{~end~}}
|
||||
|
||||
{{~for table in tables ~}}
|
||||
{{table.name}}.resolve(__tables__);
|
||||
{{~end~}}
|
||||
return true;
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user