This commit is contained in:
aozhiwei 2022-12-26 09:43:57 +08:00
parent 358672e2d5
commit b705f553f5
2 changed files with 13 additions and 4 deletions

View File

@ -3,16 +3,20 @@
#include "mt/KillReward.h"
IMPL_TABLE(mt::KillReward)
std::map<int, const mt::KillReward*> mt::KillReward::kill_hash_;
namespace mt
{
void KillReward::Init1()
{
kill_hash_[kill_num()] = this;
}
float KillReward::GetKillRewardParam(int kill_num)
{
#if 0
auto itr = loader_->killreward_hash.find(kill_num);
return itr != loader_->killreward_hash.end() ? itr->second->pb->parameter() : 0.0f;
#endif
auto itr = kill_hash_.find(kill_num);
return itr != kill_hash_.end() ? itr->second->parameter() : 0.0f;
}
}

View File

@ -11,8 +11,13 @@ namespace mt
"kill_num")
public:
void Init1();
static float GetKillRewardParam(int kill_num);
private:
static std::map<int, const mt::KillReward*> kill_hash_;
};
}