1
This commit is contained in:
parent
48d7f9f567
commit
3c39bfdda6
@ -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,21 +102,23 @@ 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();
|
||||
itr->load_cb();
|
||||
}
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (auto& itr : meta_tables) {
|
||||
itr->static_pre_init_cb();
|
||||
itr->load_cb();
|
||||
}
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (auto& itr : meta_tables) {
|
||||
if (i < itr->init_cbs.size()) {
|
||||
itr->init_cbs.at(i)();
|
||||
}
|
||||
if (i < itr->init_cbs.size()) {
|
||||
itr->init_cbs.at(i)();
|
||||
}
|
||||
}
|
||||
for (auto& itr : meta_tables) {
|
||||
itr->static_post_init_cb();
|
||||
}
|
||||
}
|
||||
for (auto& itr : meta_tables) {
|
||||
itr->static_post_init_cb();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -66,6 +66,9 @@ namespace mt
|
||||
void Init();
|
||||
void UnInit();
|
||||
|
||||
void RegMetaTables();
|
||||
void Load();
|
||||
|
||||
template<class T>
|
||||
mt::MetaTable* RegMetaTable(const std::string& dir)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user