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" #include "mt/Param.h"
std::vector<mt::Param*> mt::Param::raw_list; IMPL_TABLE(mt::Param)
std::map<long long, mt::Param*> mt::Param::id_hash;
std::map<std::string, mt::Param*> mt::Param::name_hash;
namespace mt namespace mt
{ {

View File

@ -10,6 +10,7 @@ namespace mt
"parameter@parameter.csv", "parameter@parameter.csv",
"param_name") "param_name")
public: public:
static struct {
int gas_inactive_time = 10; int gas_inactive_time = 10;
float kill_param = 0.0f; float kill_param = 0.0f;
float rank_param = 0.0f; float rank_param = 0.0f;
@ -83,6 +84,7 @@ namespace mt
int inwater_oxygen_recover = 0; int inwater_oxygen_recover = 0;
int revive_time = 15; 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); \ auto itr = name_hash.find(name); \
return itr != name_hash.end() ? itr->second : nullptr; \ 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;