This commit is contained in:
aozhiwei 2022-12-22 16:38:51 +08:00
parent ee93106b5e
commit 5a5e8fddcb
3 changed files with 9 additions and 3 deletions

View File

@ -2,9 +2,7 @@
#include "mt/Param.h"
std::vector<mt::Param*> mt::Param::raw_list;
std::map<long long, mt::Param*> mt::Param::id_hash;
std::map<std::string, mt::Param*> mt::Param::name_hash;
IMPL_TABLE(mt::Param)
namespace mt
{

View File

@ -10,6 +10,7 @@ namespace mt
"parameter@parameter.csv",
"param_name")
public:
static struct {
int gas_inactive_time = 10;
float kill_param = 0.0f;
float rank_param = 0.0f;
@ -83,6 +84,7 @@ namespace mt
int inwater_oxygen_recover = 0;
int revive_time = 15;
} s;
};
}

View File

@ -38,3 +38,9 @@ DECLARE_COMMON_HEAD(classname, base, filename, key, 2) \
auto itr = name_hash.find(name); \
return itr != name_hash.end() ? itr->second : nullptr; \
};
#define IMPL_TABLE(classname) \
std::vector<classname*> classname::raw_list; \
std::map<long long, classname*> classname::id_hash; \
std::map<std::string, classname*> classname::name_hash;