This commit is contained in:
aozhiwei 2022-12-25 14:50:58 +08:00
parent 48d7f9f567
commit 3c39bfdda6
2 changed files with 22 additions and 12 deletions

View File

@ -61,7 +61,12 @@ namespace mt
} else {
res_path_ = "../res/";
}
RegMetaTables();
Load();
}
void MetaMgr::RegMetaTables()
{
RegMetaTable<Param>(res_path_);
RegMetaTable<Hero>(res_path_);
RegMetaTable<Map>(res_path_);
@ -97,6 +102,9 @@ namespace mt
RegMetaTable<SafeAreaPos>(res_path_);
RegMetaTable<Skill>(res_path_);
RegMetaTable<SkillNumber>(res_path_);
}
void MetaMgr::Load()
{
for (auto& itr : meta_tables) {
itr->static_pre_init_cb();
@ -113,7 +121,6 @@ namespace mt
itr->static_post_init_cb();
}
}
}
void MetaMgr::UnInit()
{

View File

@ -66,6 +66,9 @@ namespace mt
void Init();
void UnInit();
void RegMetaTables();
void Load();
template<class T>
mt::MetaTable* RegMetaTable(const std::string& dir)
{