1
This commit is contained in:
parent
e650fbe947
commit
b2ac5a91a7
@ -333,7 +333,20 @@ namespace mt
|
||||
abort();
|
||||
}
|
||||
for (auto conf : s_.rank_mode_confs) {
|
||||
if (conf->min_elo >= elo && conf->max_elo) {
|
||||
if (conf->min_elo >= elo) {
|
||||
return conf.get();
|
||||
}
|
||||
}
|
||||
return s_.rank_mode_confs.at(s_.rank_mode_confs.size() - 1).get();
|
||||
}
|
||||
|
||||
const RankMatchConf* Param::GetRankModeConfByHeroLv(int hero_lv)
|
||||
{
|
||||
if (s_.rank_mode_confs.empty()) {
|
||||
abort();
|
||||
}
|
||||
for (auto conf : s_.rank_mode_confs) {
|
||||
if (conf->min_level >= hero_lv) {
|
||||
return conf.get();
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,8 @@ namespace mt
|
||||
struct RankMatchConf
|
||||
{
|
||||
RoomType_e room_type = RoomType_Rank1;
|
||||
int min_level = 0;
|
||||
int max_level = 0;
|
||||
int min_elo = 0;
|
||||
int max_elo = 0;
|
||||
int hero_min_lv = 0;
|
||||
@ -147,6 +149,7 @@ namespace mt
|
||||
static std::string GetStringParam(const std::string& param_name, const char* def_val = "");
|
||||
static int GetStarNum(int rank);
|
||||
static const RankMatchConf* GetRankModeConfByElo(int elo);
|
||||
static const RankMatchConf* GetRankModeConfByHeroLv(int hero_lv);
|
||||
static const RankMatchConf* GetRankModeConfByRoomType(int room_type);
|
||||
static int RandHeroLv(int room_type);
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user